Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Git completions for the restore subcommand #895

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion custom-completions/git/git-completions.nu
Original file line number Diff line number Diff line change
Expand Up @@ -688,4 +688,29 @@ export extern "git clone" [
--separate-git-dir: string # place the clone at =<git dir> and link it here
--jobs(-j): int # number of simultaneous submodules fetch
...args
]
]

# 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 =<style>
--ignore-unmerged # Restore from index and ignore unmerged entries (unmerged files are left as is)
--ignore-skip-worktree-bits # Ignore sparse checkout patterns and unconditionally restores any files in <pathspec>
--recurse-submodules # Restore the contents of sub-modules in working tree
--no-recurse-submodules # Do not restore the contents of sub-modules in working tree (default)
--overlay # Do not remove files that don't exist when restoring from tree with --source
--no-overlay # Remove files that don't exist when restoring from tree with --source (default)
--pathspec-from-file: string # Read pathspec from file
--pathspec-file-nul # Separate pathspec elements with NUL character when reading from file
...pathspecs: string@"nu-complete git files" # Target pathspecs to restore
]