Skip to content

Instantly share code, notes, and snippets.

@cmthakur
Created April 25, 2012 06:17
Show Gist options
  • Save cmthakur/2487096 to your computer and use it in GitHub Desktop.
Save cmthakur/2487096 to your computer and use it in GitHub Desktop.
git frequently used commands
#force push
git push -f
#track current branch to the remote
git push -u
git branch --set-upstream cmt origin/story/find_connections
#revert to the given saw
git revert <saw_id>
#arrange/manage the bulk of 5 commits
git rebase -i HEAD~5
#git log in oneline
git log --oneline
git log --graph
#to show all branch at origin
git remote show origin
#reset to the previous head
git reset --hard ORIG_HEAD
#checkout remote branch
git checkout -b test origin/test
#git config
git config --global user.name "Gregg Pollack"
$ git config --global core.editor emacs use emacs for interactive commands
$ git config --global merge.tool opendiff use opendiff for merging conflicts
$ git config --global user.email "gregg@codeschool.com"
#aliases
git config --global alias.st status
@nikita8
Copy link

nikita8 commented Sep 4, 2013

i guess it should be sha not saw..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment