git 新建本地及远程分支

164 阅读1分钟
git clone https://github.com/*.git
cd *

git checkout -b <your_name>  //在当前分支下创建你的的本地分支

<进行文件修改> 

git add <file> //将你修改过的文件添加进待提交列表。
git add --all 把所有修改过的文件添加进提交列表。现在为了方便,你可以用这个命令。

git commit -m "你的提交注释"

git push origin <your_name>   //将该分支推送到远程,此时已完成推送
git branch --set-upstream-to=origin/<your_name> //将本地分支<your_name>关联到远程分支<your_name>上