Skip to content

Instantly share code, notes, and snippets.

@theleoborges
Created May 28, 2011 09:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save theleoborges/996758 to your computer and use it in GitHub Desktop.
Save theleoborges/996758 to your computer and use it in GitHub Desktop.
A few useful git commands
#undo last commit
git reset HEAD^
#show files in a given commit
git show --pretty="format:" --name-only rev_number
#remove untracked files and directories
git clean -f -d
#track remote branch
git branch --track branch_name origin/master
#push local branch to remote
git push origin branch_name
#delete remote branch
git push origin :remote_branch_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment