Create new branch on github

Create a repository on github:
Create a new repository on the command line


touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/BrentHuang/MyRepo.git
git push -u origin master


Create a new branch locally: git branch Branch1
Switch to your new branch: git checkout Branch1
Publish the new branch on github: git push origin Branch1
Delete a branch locally: git branch -d Branch1
on github Delete a branch on the remote side: git push origin :Branch1 (the colon before the branch name represents deletion)

directly use the settings of git pull and git push

git branch --set-upstream-to=origin/master master 
git branch --set-upstream-to=origin/ThirdParty ThirdParty
git config --global push.default matching

 

Reprinted: http://blog.csdn.net/guang11cheng/article/details/37757201

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326818253&siteId=291194637