我在用Git建立一个看似简单的工作流时遇到了困难。
假设我有两个开发人员,DevA和DevB。有一个名为“原产地”的远程存储库,两个开发人员都可以访问它。
DevA从“主人”创建一个分支.
git checkout -b 'newbranch'DevA对新分支进行更改并提交
git add .
git commit -m 'newbranch changes'DevA将更改推入原点。
git push --allDevB想要分支
git fetch --allDevB想要在新分支上工作
git checkout newbranch
git pull newbranchDevB对新分支进行更改并将更改推送到原点。
git add .
git commit -m 'message'
git push --allDevA需要从远程获取更改,然后.
git checkout newbranch
git pull --all
You asked to pull from the remote '--all', but did not specify
a branch. Because this is not the default configured remote
for your current branch, you must specify a branch on the command line.然后..。
git branch -r
origin/newbranch
origin/HEAD -> origin/master
origin/master然后..。
git pull origin/newbranch
fatal: 'origin/newbranch' does not appear to be a git repository
fatal: Could not read from remote repository.有人能告诉我这里出了什么问题吗?
发布于 2014-10-17 23:12:44
试试git push --all origin或git pull --all origin
发布于 2014-10-17 23:05:49
我可能错了,但我认为当您使用git pull --all时,它认为--all是您的远程存储库的名称。
我认为DevA只是需要做:git pull origin newbranch。
另一种选择是使用git fetch origin,然后DevA可以使用git merge origin/newbranch手动进行合并。
https://stackoverflow.com/questions/26432963
复制相似问题