Monday, January 20, 2014

git cheetsheet

git config --global alias.st status
git config --global alias.co checkout
git config --global alias.ci commit
git config --global alias.di diff
git config --global alias.br branch

git config --global color.diff never

sample:

git co -b newbr
emacs ...
git ci -am ...
git co master
git merge newbr
git br -d newbr

git checkout                # switch to branch
git checkout -b             # create new topic branch (and switch)

git branch -a                            # list all branches (local+remote)

git checkout master
git merge                   # merge other into master

git branch -d               # delete local branch
git push origin --delete    # delete remote branch
git diff master..staging                 # diff two branches
git diff --name-status master..staging   # show diffing files

git log --graph --decorate --oneline
git log --graph --full-history --all --pretty=format:"%h%x09%d%x20%s"
git diff ignores owner/group
#repository local:
git config core.filemode false
more infos here: https://www.kernel.org/pub/software/scm/git/docs/git-config.html

No comments: