-
-
Save thiagocaiubi/996888 to your computer and use it in GitHub Desktop.
A few useful git commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Se vc fizer:
git push -u origin branch_name
Ele envia o branch local pro origin e já faz o track