2015-09-03 79 views
0

我刚开始使用git进行版本控制;来自svn背景。Git:fatal:无法找到远程参考my_repo

我创建了一个分支进行一些更改,名称为my_repo。我不记得我是否使用-b选项。

~MyProject$ git checkout -b my_repo or git checkout my_repo 

之后,我做了一些更改,提交并推送它们。我相信我的更改推,因为它的日志

~MyProject$ git branch 
    dev 
* my_repo 
    master 

~MyProject$ git log 
commit a2104d193c8642360e3a09cf5260739fb25 
Author: Adam Douglas <[email protected]> 
Date: Thu Sep 3 12:18:19 2015 +0530 

    Services and controllers 

commit b4a225ed1e69de39566c088c8d285936ae4 
Author: Adam Douglas <[email protected]> 
Date: Tue Sep 1 17:28:26 2015 +0530 

    DB Changes 

~MyProject$ git status 
On branch my_repo 
Untracked files: 
    (use "git add <file>..." to include in what will be committed) 

    Scraper/${sys:catalina.base}/ 

nothing added to commit but untracked files present (use "git add" to track) 

中显示出来。然而,当我尝试拉的变化,我得到你下面的错误。

~/Documents/SourceCode/IntelliJ/MyProject$ git pull origin my_repo 
fatal: Couldn't find remote ref my_repo 
~/Documents/SourceCode/IntelliJ/MyProject$ fatal: The remote end hung up unexpectedly 

这是怎么发生的?我可以在日志中看到它们。

+0

这里,命名一个分支远程仓库'my_repo'会导致许多混乱。 – Jubobs

+0

*我确定我的更改被推送,因为它显示在日志*推不记录,提交 –

+0

@TimCastelijns:谢谢,蒂姆。我的错。 – LearningToDesign

回答

1

因此很明显,分支my_repo不存在于您的远程存储库中。这可能意味着以下两种情况之一:

  1. 您已经在本地存储库上创建了一个分支,并且(可能)也提交了更改。但是,您尚未将这些更改推送到远程存储库。
  2. 这也可能意味着控制远程回购的人使用了git push --delete origin my_repo

在任何情况下,你必须先push的变化使用不考虑问题的git push origin my_repo

相关问题