Advanced Git CLI
March 07, 2022Learning Git
- https://gitimmersion.com/ really good walk-through of concepts.
- A bit dated but holds up well
- Interactive
- https://frontendmasters.com/courses/git-in-depth/ Advanced Git Course
- Really in depth, advanced topics
- https://git-scm.com/book/en/v2 Pro Git Book
- Reference style book
Zsh and Friends
- Update local git to latest with brew
- Install Oh My Zsh
- Open a new terminal and type
git che<tab>
, autocompletion should work
Inspect Aliases Provided
alias
show all aliases
alias | grep git
show all git aliases
Top Examples
..
shortcut to nav up a dir
gst
git status
gcmsg
git commit -m ...
g
git
gfa
git fetch --all --prune
grbi
git rebase --interactive
gwip
commit changes, skip ci and label [WIP]
gunwip
reset HEAD, stage WIP changes
gco
and gco -b
git checkout [-b] <branch>
Viewing State
- This is 'tracking' against 'upstream/master' (source, master)
- Shows the count of commits ahead/behind, will show diverged branches
- Fast forwarded means no merge-commit needed (clean history)
- Shows each branch, tracking, ahead/behind counts
- Shows remote branches
Tracking Branches
Keeping Repos Up To Date
gfa # git fetch --all --prune
gwip/gunwip
Merge Lockfiles
- Merge package.json, run npm install, continue merge
-- OR --
https://www.npmjs.com/package/npm-merge-driver
TK
rerere post merge install gh/hub gwip ga -p rebase fork and pull git configs