Git 创建远程分支与本地分支

git remote add remotebranchname http://…….git  //创建远程分支
git branch //查看本地分支
git branch -a //查看本地分支与远程分支
git branch branchname //创建本地分支

git checkout branchname //切换到分支branchname
git push branchname remotebranchname

关于查看本地和远程分支会出现一下结果:

  master
* ver1.0
  remotes/origin/master/master
  remotes/ver1.0/ver1.0

合并远程分支与本地分支(注意上面显示的如果是ver1.0/ver1.0必须一致)

git branch --set-upstream-to ver1.0/ver1.0 ver1.0

猜你喜欢

转载自blog.csdn.net/danfengw/article/details/79961788