- 先看看本地有哪几个分支
git branch
复制代码
2. 一般都是在自己的分支上开发,然后合并到dev(develop),所以可以看到我是在自己的分支上 3. 新建分支
git branch cheny
复制代码
- 切换到分支
git checkout cheny
复制代码
5. 查看本地代码状态
git status
复制代码
- 添加修改代码到缓存
git add .
复制代码
- 做一次提交,并且指定提交的分支
git push origin cheny
复制代码
- 提交到远程仓库
git push -u origin dev
复制代码
- 比如你在cheny分支上修改上传,合并到dev上,先在cheny上提交然后在
cheny分支
git push
切换到dev
git checkout dev
git merge
git fetch
复制代码
分支删除与合并
- 查看分支
$ git branch -a
cheny
* dev
master
remotes/origin/cheny
remotes/origin/dev
remotes/origin/huohao
remotes/origin/lisehnghui
remotes/origin/master
复制代码
- 选择要删除的分支
$ git branch -D cheny
git branch -r -d origin/cheny
$ git push origin :cheny
To 192.168.1.104:web/egoo-admin.git
- [deleted] cheny
$ git branch -a
复制代码