Skip to content

Instantly share code, notes, and snippets.

@thiagocaiubi
Forked from theleoborges/gist:996758
Created May 28, 2011 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thiagocaiubi/996888 to your computer and use it in GitHub Desktop.
Save thiagocaiubi/996888 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
#envia o branch local pro origin e já faz o track
git push -u origin branch_name
# faz o upstream do branch local com o remoto
git branch --set-upstream origin/branch_name branch_name
# tracked branch checkout
git checkout -b branch_name -t origin/branch_name
# delete remote tag
git tag -d 12345
git push origin :refs/tags/12345
@jairhenrique
Copy link

Se vc fizer:

git push -u origin branch_name

Ele envia o branch local pro origin e já faz o track

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