git分支模型是 git的必杀技
git鼓励在工作流程中频繁使用分支与合并
git clone下来之后
使用git status查看
会发现默认的分支是master
创建分支iss53并push到服务器
git branch iss53
git checkout iss53
git status
git push
这个时候去github网站上看的时候,会发现有一个新的branch iss53
现在master和issu53的指针指向同样的地方
修改分支iss53
git checkout iss53
vim index.html
add line "comments for issue 53"
git add index.html
git commit -m 'comment for issue 53'
git push
这个时候去github上去看branch iss53和buranch master的index.html的值是不一样的
合并分支iss53
跟踪远程分支
删除远程github上的分支
git push [远程名] :[分支名]
注意:之前一定要有个空格
git push origin :iss53
再去github上去看, 已经找不到iss53这个分支了
git查看所有本地branch
git branch
git查看远程所有branch
git branch -r
git查看所有branch
git branch -a
别人创建了一个branch(hotfix), 我拿下来
别人创建了一个branch(hotfix), 我将它从远程github中删除