diff --git a/git.md b/git.md index 08d8ac3..0a484b3 100644 --- a/git.md +++ b/git.md @@ -1,13 +1,32 @@ # 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 ``` + +### Fetch and remove deleted branches +```git fetch --prune``` + +### Worktree +``` +git worktree add +git worktree remove [--force] +``` +Use force if you have initialized submodules in the worktree. + +### Rebase multiple divergent branches +```git rebase --interactive --onto ``` + ### What commit added a certain file? ```git log --diff-filter=A -- path/file``` - -### Edits of a certain file +### Changes of a certain file ```git diff -- path/file``` -### Git pull +### Git pull strategy ``` hint: Pulling without specifying how to reconcile divergent branches is hint: discouraged. You can squelch this message by running one of the following