git: updated with new random utility commands.
This commit is contained in:
parent
bd5f5fad31
commit
ebcbb5a5d1
25
git.md
25
git.md
@ -1,13 +1,32 @@
|
|||||||
# Git
|
# Git
|
||||||
|
|
||||||
|
### Pronouns
|
||||||
|
- us: changes on the branch I am rebasing onto (eg. the master), usually "the good official one"
|
||||||
|
- they: changes of the branch I am rebasing (eg. feature branch)
|
||||||
|
|
||||||
|
### Search keyword
|
||||||
|
```git log -S <keyword>```
|
||||||
|
|
||||||
|
### Fetch and remove deleted branches
|
||||||
|
```git fetch --prune```
|
||||||
|
|
||||||
|
### Worktree
|
||||||
|
```
|
||||||
|
git worktree add <path> <branch>
|
||||||
|
git worktree remove [--force] <path>
|
||||||
|
```
|
||||||
|
Use force if you have initialized submodules in the worktree.
|
||||||
|
|
||||||
|
### Rebase multiple divergent branches
|
||||||
|
```git rebase --interactive --onto <newparent> <oldparent>```
|
||||||
|
|
||||||
### What commit added a certain file?
|
### What commit added a certain file?
|
||||||
```git log --diff-filter=A -- path/file```
|
```git log --diff-filter=A -- path/file```
|
||||||
|
|
||||||
|
### Changes of a certain file
|
||||||
### Edits of a certain file
|
|
||||||
```git diff <branch> -- path/file```
|
```git diff <branch> -- path/file```
|
||||||
|
|
||||||
### Git pull
|
### Git pull strategy
|
||||||
```
|
```
|
||||||
hint: Pulling without specifying how to reconcile divergent branches is
|
hint: Pulling without specifying how to reconcile divergent branches is
|
||||||
hint: discouraged. You can squelch this message by running one of the following
|
hint: discouraged. You can squelch this message by running one of the following
|
||||||
|
Loading…
Reference in New Issue
Block a user