From 7471b4d9661e54eeee370e80f567118dabf9a9de Mon Sep 17 00:00:00 2001 From: Okdro <105592286+Okdro@users.noreply.github.com> Date: Tue, 16 Jul 2024 19:20:00 +0200 Subject: [PATCH] Added Git completions for the restore subcommand (#895) Added `git restore` to git completions, as I was missing tab completion for that. I've begun to use Nushell regularly, so I hope this addition will be useful to others as it is to me. Feedback is appreciated if there's any conventions I've missed, or options that need better wording. --- custom-completions/git/git-completions.nu | 27 ++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/custom-completions/git/git-completions.nu b/custom-completions/git/git-completions.nu index afbae8d..9fff56b 100644 --- a/custom-completions/git/git-completions.nu +++ b/custom-completions/git/git-completions.nu @@ -688,4 +688,29 @@ export extern "git clone" [ --separate-git-dir: string # place the clone at = and link it here --jobs(-j): int # number of simultaneous submodules fetch ...args -] \ No newline at end of file +] + +# Restores files in working tree or index to previous versions +export extern "git restore" [ + --help(-h) # Display the help message for this command + --source(-s) # Restore the working tree files with the content from the given tree + --patch(-p) # Interactively choose hunks to restore + --worktree(-W) # Restore working tree (default if neither --worktree or --staged is used) + --staged(-S) # Restore index + --quiet(-q) # Quiet, suppress feedback messages + --progress # Force progress reporting + --no-progress # Suppress progress reporting + --ours # Restore from index using our version for unmerged files + --theirs # Restore from index using their version for unmerged files + --merge(-m) # Restore from index and recreate the conflicted merge in unmerged files + --conflict: string # Like --merge but changes the conflict presentation with =