Last active
August 29, 2015 14:19
-
-
Save tonycn/6a42d35f5ca0d90be85e to your computer and use it in GitHub Desktop.
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
git clone git://xxx | |
git remote add upstream git://xxx | |
# create branch to develop | |
git checkout -b dev | |
git add file1 | |
git commit ... | |
# fetch and rebase to upstream/master | |
git fetch upstream | |
git rebase -i upstream/master | |
git push origin HEAD | |
# Pull request | |
# branch related commands | |
git branch -a | |
git checkout branchA | |
git checkout -b newBranch | |
# how to rollback | |
git reset --soft HEAD^1 | |
git reset --hard upstream/master | |
# git remote repo | |
git remote -v | |
git remote add origin git://xxx | |
#force push remote repo | |
git push -f origin HEAD | |
# misc | |
git help {command} | |
git clean -df | |
git stash / git stash pop | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment