我刚刚开始使用git进行版本控制;来自svn背景。
我创建了一个分支进行名称更改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
为什么会这样呢?我可以在日志中看到它们。
因此很明显,该分支my_repo
在您的远程存储库中不存在。这可能意味着两件事之一:
git push --delete origin my_repo
。无论如何,您都必须先使用push
以下命令对远程存储库进行更改git push origin my_repo
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句