在本地master分支上新建的分支pull 与 push
2018-08-31 11:44
615 查看
在本地master分支上新建的Monitor分支pull操作:
若Git服务器上没有Monitor分支:
在本地Monitor分支:
原因:
Git 服务器上没有对应的分支与本地新分支关联,所以git pull失败
解决方法:
Monitor是本地新分支
成功:
完成这一步,并不代表git push就能直接将本分支的内容更新到服务器master分支。
失败:
成功:
若Git服务器上没有Monitor分支:
在本地Monitor分支:
git pull无法把Git服务器上的master分支的最新文件下拉,提示:
There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details. git pull <remote> <branch> If you wish to set tracking information for this branch you can do so with: ###如果您希望为此分支设置跟踪信息,可以使用以下命令: git branch --set-upstream-to=origin/<branch> Monitor
原因:
Git 服务器上没有对应的分支与本地新分支关联,所以git pull失败
解决方法:
git branch --set-upstream-to=origin/master Monitororigin/master是 Git服务器上的分支
Monitor是本地新分支
成功:
q@s:~/Documents/Practice/test$ git pull Username for 'http://**': s** Password for 'http://s**@**': Updating 204699a..2720802 Fast-forward one_branch_1.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
完成这一步,并不代表git push就能直接将本分支的内容更新到服务器master分支。
失败:
git push
fatal: The upstream branch of your current branch does not match the name of your current branch. To push to the upstream branch on the remote, use git push origin HEAD:master To push to the branch of the same name on the remote, use git push origin Monitor
成功:
git push origin HEAD:master #########将本地Monitor分支的文件 更新到 Git服务器上的master分支
git push origin Monitor ###########将本地的Monitor分支文件 更新到 Git服务器上的Monitor分支(由于原先Git服务器上是没有Monitor分支,所以Git服务器会自动创建Monitor分支)
相关文章推荐
- git的操作(拉代码到本地/commit到本地/pull/push到远程/新建分支/合并分支/)
- git---基本操作、新建分支,合并分支branch到主干master ,git pull ,git push
- git 本地新建分支操作功能后与本地master合并,然后提交到远程master
- $ git push origin test:master // 提交本地test分支 作为 远程的master分支
- Git新建本地分支,并push到服务器上这个分支(服务器上此分支并不存在)
- 解决本地上传远程的冲突两种方式的区别:git push -f origin master和git pull --rebase origin master
- 拾遗:git pull 与 push 远程分支与本地分支顺序识别问题
- (git fetch git push git pull)远程本地分支互相推送更新
- github更新网站内容,然后在本地commit,pull,push后,刷新网站没有出现更新的内容
- error: failed to push some refs to 'git@x'x'x:xxxx/xxx.git' git提交本地分支到远程报错
- git合并分支报错 :Branch 'master' is protected and commits must be merged through pull request
- GIT本地删除除master以外所有分支
- 在本地master分支上做了一次commit,怎么办
- git 命令之 如何将本地新建分支推到服务器上
- git 拉取远程指定分支 pull本地不存在的分支
- 【Git学习笔记】用git pull取回远程仓库某个分支的更新,再与本地的指定分支自动merge
- git本地免密码和账号pull、push
- git本地仓库首次push到远程仓库出现错误 ! [rejected] master -> master (fetch first)
- 从远程仓库提取分支并在本地新建一个分支[转]
- git 项目url改变,本地不能pull,push问题