News

Aliases

alias.root=rev-parse --show-toplevel
# or:
alias.root=!pwd

Commands

$ git merge-base
$ git submodule
$ git subtree
$ git log --graph --decorate --oneline

*   cafebabe (HEAD, master) Merge branch 'feature'
|\  
| * 1122331 consectetur adipisicing elit, sed do eiusmod
| * 1234567 Lorem ipsum dolor sit amet
* | caaffee Excepteur sint occaecat cupidatat non
|/  
* baabbee Ut enim ad minim veniam
* 22cafe2 cillum dolore eu fugiat nulla pariatur
$ git branch --all --contains cafebabe

  master
* feature-branch
  remotes/origin/HEAD -> origin/master
  remotes/origin/master
$ git merge-base --is-ancestor cafebabe master && echo "cafebabe is on master" || echo "cafebabe is not on master"

cafebabe is on master
 $ git check-ignore build -q || echo build >> .gitignore

Move git branch to another location e.g. one commit back

  $ git reset --hard HEAD^ 
  $ git push -f 

Only checkout a subdirectory

i’ll do a tldr at some point in time - but for now, this is also nice enough:

Git Log Pretty

$ git log --graph --decorate --pretty=fuller