Last active
December 22, 2015 08:29
-
-
Save ljinke/6445609 to your computer and use it in GitHub Desktop.
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
/*start from local*/ | |
//create repository in github and add .gitignore/readme.md | |
//init the local folder | |
git init myfolder | |
//add created remote repository | |
git remote add origin https://github.com/liujin/test.git | |
git fetch origin | |
//commit local changes | |
git add . | |
git commmit -m "init commit" | |
git push origin | |
//Start from remote | |
git clone https://github.com/liujin/test.git | |
git remote -v | |
//Start from forked | |
//fork in github | |
//clone forked repository\ | |
git clone https://github.com/liujin/forked.git | |
//add upstream repository | |
git remote add upstream https://github.com/test.git | |
git remote rm upstream | |
git remote rename origin upstream | |
git checkout mybranch | |
git fetch upstream/develop | |
get merge upstream/develop | |
git pull upstream/develop | |
//create a new branch from the existing one | |
git checkout -b newBranch develop | |
//merge a feature to develop branch | |
git checkout develop | |
git merge newBranch | |
git push origin develop | |
git push upstream/develop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment