mirror of
https://github.com/tldr-pages/tldr.git
synced 2026-08-28 20:11:19 +08:00
git-{filter-branch, rerere, merge-tree}: add page (#18865)
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
# git filter-branch
|
||||
|
||||
> Change branch history, like removing files.
|
||||
> More information: <https://git-scm.com/docs/git-filter-branch>.
|
||||
|
||||
- Remove a file from all commits:
|
||||
|
||||
`git filter-branch --tree-filter 'rm {{[-f|--force]}} {{file}}' HEAD`
|
||||
|
||||
- Update author email:
|
||||
|
||||
`git filter-branch --env-filter 'GIT_AUTHOR_EMAIL={{new_email}}' HEAD`
|
||||
|
||||
- Delete a folder from history:
|
||||
|
||||
`git filter-branch --tree-filter 'rm {{[-rf|--recursive --force]}} {{folder}}' HEAD`
|
||||
@@ -0,0 +1,12 @@
|
||||
# git merge-tree
|
||||
|
||||
> Merge branches without changing files.
|
||||
> More information: <https://git-scm.com/docs/git-merge-tree>.
|
||||
|
||||
- Show the result of a merge between two branches:
|
||||
|
||||
`git merge-tree {{branch1}} {{branch2}}`
|
||||
|
||||
- Perform a merge and write the resulting tree:
|
||||
|
||||
`git merge-tree --write-tree {{branch1}} {{branch2}}`
|
||||
@@ -0,0 +1,16 @@
|
||||
# git rerere
|
||||
|
||||
> Reuse fixes for merge conflicts.
|
||||
> More information: <https://git-scm.com/docs/git-rerere>.
|
||||
|
||||
- Enable rerere globally:
|
||||
|
||||
`git config --global rerere.enabled true`
|
||||
|
||||
- Forget a file's recorded resolution:
|
||||
|
||||
`git rerere forget {{path/to/file}}`
|
||||
|
||||
- Check the status of recorded resolutions:
|
||||
|
||||
`git rerere status`
|
||||
Reference in New Issue
Block a user