做个笔记,方便自己,也方便大家取用。
需要的话可以收藏、转发,随时用!
一、创建分支
git branch <branch-name>
branch-name:起个分支名字
二、查看本地分支
git branch
查看远程分支
- git branch -r
- git branch -a
三、切换分支
git checkout <branch-name>
branch-name:要切换的分支名字;创建分支的同时,并切换到该分支
git checkout -b <branch-name>
四、查看分支状态
git status
查看所在分支;分支中修改了什么内容;
五、拉取代码
git pull origin 远程分支名|本地分支名
git remote -vv