git分支管理

最后都变了- 提交于 2020-01-13 05:08:32

git分支建立,切换,查看,删除

常用指令如下

https://www.runoob.com/git/git-branch.html

git checkout -b test1 #建立新分支test1,并切换到上面

git checkout  test1 #切换到分支test1

git branch #查看本地分支

git branch -a #查看所有分支

git branch -d test1 #删掉分支test1

git branch -D test #强制删除分支test1

git合并

合并历程和原理

https://git-scm.com/book/zh/v2/Git-%E5%88%86%E6%94%AF-%E5%88%86%E6%94%AF%E7%9A%84%E6%96%B0%E5%BB%BA%E4%B8%8E%E5%90%88%E5%B9%B6

git分支的讲解视频

讲解视频在仓库>git>git分支与合并

https://github.com/mocas-usr/document.git

git远程常用的分支操作

使用git remote -v,查看clone地址

git branch -a 查看所有分支,包括远程的

git remote add origin  ssh(http:/)将本地所在分支推送到github上

git remote add [name] [url]
示例:git remote add practice https://github.com/pzq-pzq/practice.git
说明:上述中的name与erl一一匹配,将name作为连接的标识

修改可采用先删除后添加
删除远程仓库git remote rm [name]
示例:git remote rm practice

推送到特定的远程仓库

git push [remote] [branch]
示例:git push practice [暂空]
说明:这样每次输入不同的remote,便可上传到不同的远程仓库

获取远程仓库的内容

git pull [remote] [branch]
示例:git pull practice [暂空]
说明:获取name为practice的远程仓库的内容

 

 

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!