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合并
合并历程和原理
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的远程仓库的内容