git pull 不工作

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2433637/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 08:02:31  来源:igfitidea点击:

git pull not working

git

提问by Nick Vanderbilt

I am not using github. We have git setup on our machine.

我没有使用github。我们的机器上有 git 设置。

I created a branch from master called experiment. However when I am trying to do git pull I am getting following message.

我从master创建了一个名为experiment的分支。但是,当我尝试执行 git pull 时,我收到以下消息。

> git pull
You asked me to pull without telling me which branch you
want to merge with, and 'branch.experiment.merge' in
your configuration file does not tell me either.    Please
specify which branch you want to merge on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.

Here is result of git remote show origin

这是 git remote show origin 的结果

> git remote show origin
* remote origin
  Fetch URL: ssh://git.domain.com/var/git/app.git
  Push  URL: ssh://git.domain.com/var/git/app.git
  HEAD branch: master
  Remote branches:

    experiment      tracked
    master          tracked
  Local branches configured for 'git pull':
    master     merges with remote master
  Local refs configured for 'git push':
    experiment pushes to experiment (local out of date)
    master     pushes to master     (up to date)

As I read the message above experiment is mapped to origin/experiment. And my local repository knows that it is out of date. Then why I am not able to do git pull?

当我阅读上面的消息时,实验被映射到原点/实验。我的本地存储库知道它已经过时了。那为什么我不能做 git pull 呢?

This is how I created this branch

这就是我创建这个分支的方式

git co -b experiment origin/experiment

git co -b experiment origin/experimen

回答by Stewie Griffin

Pull:

拉:

git pull origin experiment

Push:

推:

git push origin experiment

回答by MBO

Check answers for this questionfor informations and change "master" to "experiment" for your example

检查此问题的答案以获取信息,并将示例中的“master”更改为“experiment”

回答by Opster Elasticsearch Pro-Vijay

I was facing this issue in my eclipse github plugin .

我在我的 eclipse github 插件中遇到了这个问题。

This might be happening because of some conflict files present in your repository .And you was still trying to check in files . So After that what happen , it will check in your local repository not in master repository . So u was not able to pull or check in anythings in master(head) repository .

这可能是因为您的存储库中存在一些冲突文件。而您仍在尝试签入文件。所以在那之后发生了什么,它将检查您的本地存储库而不是主存储库。因此,您无法在 master(head) 存储库中提取或检入任何内容。

I have one solution might be useful , it works for me maximum times. Just follow these steps :- 1)right click on conflict file 2)click on replace with -> head revision 3)wait for some times (keep patient , it will take time ) 4)repeat all previous steps for all conflict files

我有一个可能有用的解决方案,它对我最有效。只需按照以下步骤操作:- 1)右键单击冲突文件 2)单击替换为 -> 头部修订 3)等待一段时间(保持耐心,这需要时间) 4)对所有冲突文件重复之前的所有步骤