git-*: convert options to longform and minor fixes (#13441)

Co-authored-by: spageektti <git@spageektti.cc>
Co-authored-by: Fazle Arefin <fazlearefin@users.noreply.github.com>
This commit is contained in:
Managor
2024-08-31 14:06:48 +03:00
committed by GitHub
parent 6d983d1acb
commit db25f60eb1
20 changed files with 46 additions and 46 deletions

View File

@@ -9,7 +9,7 @@
- Add all files (tracked and untracked): - Add all files (tracked and untracked):
`git add -A` `git add {{--all|-A}}`
- Add all files in the current folder: - Add all files in the current folder:
@@ -17,20 +17,20 @@
- Only add already tracked files: - Only add already tracked files:
`git add -u` `git add {{--update|-u}}`
- Also add ignored files: - Also add ignored files:
`git add -f` `git add {{--force|-f}}`
- Interactively stage parts of files: - Interactively stage parts of files:
`git add -p` `git add {{--patch|-p}}`
- Interactively stage parts of a given file: - Interactively stage parts of a given file:
`git add -p {{path/to/file}}` `git add {{--patch|-p}} {{path/to/file}}`
- Interactively stage a file: - Interactively stage a file:
`git add -i` `git add {{--interactive|-i}}`

View File

@@ -11,7 +11,7 @@
- Print a file with the author [e]mail and commit hash prepended to each line: - Print a file with the author [e]mail and commit hash prepended to each line:
`git annotate -e {{path/to/file}}` `git annotate {{--show-email|-e}} {{path/to/file}}`
- Print only rows that match a regular expression: - Print only rows that match a regular expression:

View File

@@ -5,24 +5,24 @@
- Create a tar archive from the contents of the current HEAD and print it to `stdout`: - Create a tar archive from the contents of the current HEAD and print it to `stdout`:
`git archive --verbose HEAD` `git archive {{--verbose|-v}} HEAD`
- Use the Zip format and report progress verbosely: - Use the Zip format and report progress verbosely:
`git archive {{-v|--verbose}} --format zip HEAD` `git archive {{--verbose|-v}} --format zip HEAD`
- Output the Zip archive to a specific file: - Output the Zip archive to a specific file:
`git archive -v {{-o|--output}} {{path/to/file.zip}} HEAD` `git archive {{--verbose|-v}} {{--output|-o}} {{path/to/file.zip}} HEAD`
- Create a tar archive from the contents of the latest commit of a specific branch: - Create a tar archive from the contents of the latest commit of a specific branch:
`git archive -o {{path/to/file.tar}} {{branch_name}}` `git archive {{--output|-o}} {{path/to/file.tar}} {{branch_name}}`
- Use the contents of a specific directory: - Use the contents of a specific directory:
`git archive -o {{path/to/file.tar}} HEAD:{{path/to/directory}}` `git archive {{--output|-o}} {{path/to/file.tar}} HEAD:{{path/to/directory}}`
- Prepend a path to each file to archive it inside a specific directory: - Prepend a path to each file to archive it inside a specific directory:
`git archive -o {{path/to/file.tar}} --prefix {{path/to/prepend}}/ HEAD` `git archive {{--output|-o}} {{path/to/file.tar}} --prefix {{path/to/prepend}}/ HEAD`

View File

@@ -9,7 +9,7 @@
- Print file with author email and commit hash on each line: - Print file with author email and commit hash on each line:
`git blame -e {{path/to/file}}` `git blame {{--show-email|-e}} {{path/to/file}}`
- Print file with author name and commit hash on each line at a specific commit: - Print file with author name and commit hash on each line at a specific commit:

View File

@@ -25,11 +25,11 @@
- Rename a branch (must not have it checked out to do this): - Rename a branch (must not have it checked out to do this):
`git branch -m {{old_branch_name}} {{new_branch_name}}` `git branch {{--move|-m}} {{old_branch_name}} {{new_branch_name}}`
- Delete a local branch (must not have it checked out to do this): - Delete a local branch (must not have it checked out to do this):
`git branch -d {{branch_name}}` `git branch {{--delete|-d}} {{branch_name}}`
- Delete a remote branch: - Delete a remote branch:

View File

@@ -17,7 +17,7 @@
- Create a bundle file of the latest 7 days: - Create a bundle file of the latest 7 days:
`git bundle create {{path/to/file.bundle}} --since={{7.days}} {{HEAD}}` `git bundle create {{path/to/file.bundle}} --since {{7.days}} {{HEAD}}`
- Verify that a bundle file is valid and can be applied to the current repository: - Verify that a bundle file is valid and can be applied to the current repository:

View File

@@ -5,7 +5,7 @@
- Show commits (and their messages) with equivalent commits upstream: - Show commits (and their messages) with equivalent commits upstream:
`git cherry -v` `git cherry {{--verbose|-v}}`
- Specify a different upstream and topic branch: - Specify a different upstream and topic branch:

View File

@@ -9,19 +9,19 @@
- [i]nteractively delete untracked files: - [i]nteractively delete untracked files:
`git clean -i` `git clean {{--interactive|-i}}`
- Show which files would be deleted without actually deleting them: - Show which files would be deleted without actually deleting them:
`git clean --dry-run` `git clean --dry-run`
- [f]orcefully delete untracked files: - Forcefully delete untracked files:
`git clean -f` `git clean {{--force|-f}}`
- [f]orcefully delete untracked [d]irectories: - Forcefully delete untracked [d]irectories:
`git clean -fd` `git clean {{--force|-f}} -d`
- Delete untracked files, including e[x]cluded files (files ignored in `.gitignore` and `.git/info/exclude`): - Delete untracked files, including e[x]cluded files (files ignored in `.gitignore` and `.git/info/exclude`):

View File

@@ -13,7 +13,7 @@
- Display changes in patch format: - Display changes in patch format:
`git diff-tree -p {{tree-ish1}} {{tree-ish2}}` `git diff-tree {{--patch|-p}} {{tree-ish1}} {{tree-ish2}}`
- Filter changes by a specific path: - Filter changes by a specific path:

View File

@@ -13,7 +13,7 @@
- Change the Git LFS endpoint URL (useful if the LFS server is separate from the Git server): - Change the Git LFS endpoint URL (useful if the LFS server is separate from the Git server):
`git config -f .lfsconfig lfs.url {{lfs_endpoint_url}}` `git config {{--file|-f}} .lfsconfig lfs.url {{lfs_endpoint_url}}`
- List tracked patterns: - List tracked patterns:

View File

@@ -9,7 +9,7 @@
- Show the history of a particular file or directory, including differences: - Show the history of a particular file or directory, including differences:
`git log -p {{path/to/file_or_directory}}` `git log {{--patch|-p|-u}} {{path/to/file_or_directory}}`
- Show an overview of which file(s) changed in each commit: - Show an overview of which file(s) changed in each commit:
@@ -23,14 +23,14 @@
`git log --oneline --decorate --all --graph` `git log --oneline --decorate --all --graph`
- Show only commits whose messages include a given string (case-insensitively): - Show only commits with messages that include a specific string, ignoring case:
`git log -i --grep {{search_string}}` `git log {{--regexp-ignore-case|-i}} --grep {{search_string}}`
- Show the last N commits from a certain author: - Show the last N number of commits from a certain author:
`git log -n {{number}} --author={{author}}` `git log {{--max-count|-n} {{number}} --author "{{author}}"`
- Show commits between two dates (yyyy-mm-dd): - Show commits between two dates (yyyy-mm-dd):
`git log --before="{{2017-01-29}}" --after="{{2017-01-17}}"` `git log --before "{{2017-01-29}}" --after "{{2017-01-17}}"`

View File

@@ -10,7 +10,7 @@
- Start an interactive rebase, which allows the commits to be reordered, omitted, combined or modified: - Start an interactive rebase, which allows the commits to be reordered, omitted, combined or modified:
`git rebase -i {{target_base_branch_or_commit_hash}}` `git rebase {{--interactive|-i}} {{target_base_branch_or_commit_hash}}`
- Continue a rebase that was interrupted by a merge failure, after editing conflicting files: - Continue a rebase that was interrupted by a merge failure, after editing conflicting files:
@@ -30,8 +30,8 @@
- Reapply the last 5 commits in-place, stopping to allow them to be reordered, omitted, combined or modified: - Reapply the last 5 commits in-place, stopping to allow them to be reordered, omitted, combined or modified:
`git rebase -i {{HEAD~5}}` `git rebase {{--interactive|-i}} {{HEAD~5}}`
- Auto-resolve any conflicts by favoring the working branch version (`theirs` keyword has reversed meaning in this case): - Auto-resolve any conflicts by favoring the working branch version (`theirs` keyword has reversed meaning in this case):
`git rebase -X theirs {{branch_name}}` `git rebase {{--strategy-option|-X}} theirs {{branch_name}}`

View File

@@ -13,4 +13,4 @@
- Show only the 5 latest entries in the reflog: - Show only the 5 latest entries in the reflog:
`git reflog -n {{5}}` `git reflog {{--dry-run|-n}} {{5}}`

View File

@@ -5,7 +5,7 @@
- List existing remotes with their names and URLs: - List existing remotes with their names and URLs:
`git remote -v` `git remote {{--verbose|-v}}`
- Show information about a remote: - Show information about a remote:

View File

@@ -9,11 +9,11 @@
- Print the latest commit that changed (add/edit/remove) a specific file on the current branch: - Print the latest commit that changed (add/edit/remove) a specific file on the current branch:
`git rev-list -n 1 HEAD -- {{path/to/file}}` `git rev-list {{--max-count|-n}} 1 HEAD -- {{path/to/file}}`
- List commits more recent than a specific date, on a specific branch: - List commits more recent than a specific date, on a specific branch:
`git rev-list --since={{'2019-12-01 00:00:00'}} {{branch_name}}` `git rev-list --since "{{2019-12-01 00:00:00}}" {{branch_name}}`
- List all merge commits on a specific commit: - List all merge commits on a specific commit:

View File

@@ -21,4 +21,4 @@
- Don't create new commits, just change the working tree: - Don't create new commits, just change the working tree:
`git revert -n {{0c01a9..9a1743}}` `git revert {{--no-commit|-n}} {{0c01a9..9a1743}}`

View File

@@ -4,7 +4,7 @@
> Patches can be specified as files, directions, or a revision list. > Patches can be specified as files, directions, or a revision list.
> More information: <https://git-scm.com/docs/git-send-email>. > More information: <https://git-scm.com/docs/git-send-email>.
- Send the last commit in the current branch: - Send the last commit in the current branch interactively:
`git send-email -1` `git send-email -1`

View File

@@ -9,11 +9,11 @@
- View a summary of all the commits made, sorted by the number of commits made: - View a summary of all the commits made, sorted by the number of commits made:
`git shortlog -n` `git shortlog {{--numbered|-n}}`
- View a summary of all the commits made, grouped by the committer identities (name and email): - View a summary of all the commits made, grouped by the committer identities (name and email):
`git shortlog -c` `git shortlog {{--committer|-c}}`
- View a summary of the last 5 commits (i.e. specify a revision range): - View a summary of the last 5 commits (i.e. specify a revision range):
@@ -21,8 +21,8 @@
- View all users, emails and the number of commits in the current branch: - View all users, emails and the number of commits in the current branch:
`git shortlog -sne` `git shortlog {{--summary|-s}} {{--numbered|-n}} {{--email|-e}}`
- View all users, emails and the number of commits in all branches: - View all users, emails and the number of commits in all branches:
`git shortlog -sne --all` `git shortlog {{--summary|-s}} {{--numbered|-n}} {{--email|-e}} --all`

View File

@@ -9,7 +9,7 @@
- Clone an SVN repository starting at a given revision number: - Clone an SVN repository starting at a given revision number:
`git svn clone -r{{1234}}:HEAD {{https://svn.example.net/subversion/repo}} {{local_dir}}` `git svn clone {{--revision|-r}} {{1234}}:HEAD {{https://svn.example.net/subversion/repo}} {{local_dir}}`
- Update local clone from the remote SVN repository: - Update local clone from the remote SVN repository:

View File

@@ -22,7 +22,7 @@
- Delete the tag with the given name: - Delete the tag with the given name:
`git tag -d {{tag_name}}` `git tag {{--delete|-d}} {{tag_name}}`
- Get updated tags from remote: - Get updated tags from remote: