mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-01-26 11:33:59 +00:00
Update cheatsheets
This commit is contained in:
12
tldr/git-add
12
tldr/git-add
@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Add all files (tracked and untracked):
|
||||
|
||||
`git add -A`
|
||||
`git add {{--all|-A}}`
|
||||
|
||||
- Add all files in the current folder:
|
||||
|
||||
@@ -22,20 +22,20 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Only add already tracked files:
|
||||
|
||||
`git add -u`
|
||||
`git add {{--update|-u}}`
|
||||
|
||||
- Also add ignored files:
|
||||
|
||||
`git add -f`
|
||||
`git add {{--force|-f}}`
|
||||
|
||||
- Interactively stage parts of files:
|
||||
|
||||
`git add -p`
|
||||
`git add {{--patch|-p}}`
|
||||
|
||||
- Interactively stage parts of a given file:
|
||||
|
||||
`git add -p {{path/to/file}}`
|
||||
`git add {{--patch|-p}} {{path/to/file}}`
|
||||
|
||||
- Interactively stage a file:
|
||||
|
||||
`git add -i`
|
||||
`git add {{--interactive|-i}}`
|
||||
|
||||
@@ -16,7 +16,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- 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:
|
||||
|
||||
|
||||
@@ -10,24 +10,24 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- 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:
|
||||
|
||||
`git archive {{-v|--verbose}} --format zip HEAD`
|
||||
`git archive {{--verbose|-v}} --format zip HEAD`
|
||||
|
||||
- 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:
|
||||
|
||||
`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:
|
||||
|
||||
`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:
|
||||
|
||||
`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`
|
||||
|
||||
@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- 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:
|
||||
|
||||
|
||||
@@ -30,11 +30,11 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- 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):
|
||||
|
||||
`git branch -d {{branch_name}}`
|
||||
`git branch {{--delete|-d}} {{branch_name}}`
|
||||
|
||||
- Delete a remote branch:
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- 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:
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Show commits (and their messages) with equivalent commits upstream:
|
||||
|
||||
`git cherry -v`
|
||||
`git cherry {{--verbose|-v}}`
|
||||
|
||||
- Specify a different upstream and topic branch:
|
||||
|
||||
|
||||
@@ -14,19 +14,19 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- [i]nteractively delete untracked files:
|
||||
|
||||
`git clean -i`
|
||||
`git clean {{--interactive|-i}}`
|
||||
|
||||
- Show which files would be deleted without actually deleting them:
|
||||
|
||||
`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`):
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- 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:
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- 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:
|
||||
|
||||
|
||||
12
tldr/git-log
12
tldr/git-log
@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- 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:
|
||||
|
||||
@@ -28,14 +28,14 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`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):
|
||||
|
||||
`git log --before="{{2017-01-29}}" --after="{{2017-01-17}}"`
|
||||
`git log --before "{{2017-01-29}}" --after "{{2017-01-17}}"`
|
||||
|
||||
@@ -15,7 +15,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- 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:
|
||||
|
||||
@@ -35,8 +35,8 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- 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):
|
||||
|
||||
`git rebase -X theirs {{branch_name}}`
|
||||
`git rebase {{--strategy-option|-X}} theirs {{branch_name}}`
|
||||
|
||||
@@ -18,4 +18,4 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Show only the 5 latest entries in the reflog:
|
||||
|
||||
`git reflog -n {{5}}`
|
||||
`git reflog {{--dry-run|-n}} {{5}}`
|
||||
|
||||
@@ -10,7 +10,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- List existing remotes with their names and URLs:
|
||||
|
||||
`git remote -v`
|
||||
`git remote {{--verbose|-v}}`
|
||||
|
||||
- Show information about a remote:
|
||||
|
||||
|
||||
@@ -14,11 +14,11 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- 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:
|
||||
|
||||
`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:
|
||||
|
||||
|
||||
@@ -26,4 +26,4 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Don't create new commits, just change the working tree:
|
||||
|
||||
`git revert -n {{0c01a9..9a1743}}`
|
||||
`git revert {{--no-commit|-n}} {{0c01a9..9a1743}}`
|
||||
|
||||
@@ -9,7 +9,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
> Patches can be specified as files, directions, or a revision list.
|
||||
> 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`
|
||||
|
||||
|
||||
@@ -14,11 +14,11 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- 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):
|
||||
|
||||
`git shortlog -c`
|
||||
`git shortlog {{--committer|-c}}`
|
||||
|
||||
- View a summary of the last 5 commits (i.e. specify a revision range):
|
||||
|
||||
@@ -26,8 +26,8 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- 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:
|
||||
|
||||
`git shortlog -sne --all`
|
||||
`git shortlog {{--summary|-s}} {{--numbered|-n}} {{--email|-e}} --all`
|
||||
|
||||
@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- 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:
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Delete the tag with the given name:
|
||||
|
||||
`git tag -d {{tag_name}}`
|
||||
`git tag {{--delete|-d}} {{tag_name}}`
|
||||
|
||||
- Get updated tags from remote:
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`http --print {{H|B|h|b|m|Hh|Hhb|...}} {{https://example.com}}`
|
||||
|
||||
- Specify the HTTP method when sending a request:
|
||||
- Specify the HTTP method when sending a request and use a proxy to intercept the request:
|
||||
|
||||
`http {{GET|POST|HEAD|PUT|PATCH|DELETE|...}} {{https://example.com}}`
|
||||
`http {{GET|POST|HEAD|PUT|PATCH|DELETE|...}} --proxy {{http|https}}:{{http://localhost:8080|socks5://localhost:9050|...}} {{https://example.com}}`
|
||||
|
||||
- Follow any `3xx` redirects and specify additional headers in a request:
|
||||
|
||||
|
||||
@@ -31,3 +31,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
- Install a package in a virtual environment with pip arguments:
|
||||
|
||||
`pipx install --pip-args='{{pip-args}}' {{package}}`
|
||||
|
||||
- Upgrade/reinstall/uninstall all installed packages:
|
||||
|
||||
`pipx {{upgrade-all|uninstall-all|reinstall-all}}`
|
||||
|
||||
@@ -32,3 +32,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
- Destroy a program and its infrastructure:
|
||||
|
||||
`pulumi destroy`
|
||||
|
||||
- Use Pulumi locally, independent of a Pulumi Cloud:
|
||||
|
||||
`pulumi login {{-l|--local}}`
|
||||
|
||||
@@ -19,3 +19,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
- Preview and deploy changes in a specific stack:
|
||||
|
||||
`pulumi up --stack {{stack}}`
|
||||
|
||||
- Don't display stack outputs:
|
||||
|
||||
`pulumi up --suppress-outputs`
|
||||
|
||||
Reference in New Issue
Block a user