Thursday, 14 June 2012

Usefull git commands

  • git config --global color.ui auto - add coloring for git command line
  • git pull --rebase - it makes sense to be the default for pulling from the remote repository
  • git merge --no-ff - does not forget about branch which was merged in even if it was fast forward one
  • git rm --cached file - removing file only from git, not form file system
  • git diff --cached - see what will go in the next commit
  • git branch --no-merged - branched that are not merged
  • git rebase master - rebasing current branch against master
  • git mergetool - invoking tool for merging
  • git stash - hiding temporary files changes e.g. for rebasing
  • git stash pop - uncover changes hidden by stash command
  • git reset HEAD file - reset staged changes to the file
  • git checkout HEAD file - removing changes to the file

No comments: