无法再拉/推我的 git 存储库.“合并冲突"
我在多个文件中对我的项目存储库进行了更改.然后我承诺并没有推动他们.后来我在代码中发现了一个错误并打开了 git log 以恢复上次提交.由于我这样做了,这个提交已经从日志中消失,并且由于错误,我无法同时推送或拉取存储库.
I have made changes to my project repository in several files. Then i commited and didn't pushed em. Later i've found a bug in code and opened git log to revert the last commit. Since i did it this commit has disappeared from log, and i cannot both push or pull repository due to an error.
我尝试进行新的提交,但这只会改变拉/推的错误信息:
I've tried making a new commit but this only changed the error message on pull/push:
libgit2 引发了一个错误.类别 = 21(合并冲突).5未提交的更改将被合并覆盖
An error was raised by libgit2. Category = 21 (MergeConflict). 5 uncommitted changes would be overwritten by merge
git status
消息:
在分支master上
你的分支和'origin/master'有分歧,有1和1分别提交不同的提交.(使用git pull"合并远程分支到你的)
Your branch and 'origin/master' have diverged, and have 1 and 1 different commit each, respectively. (use "git pull" to merge the remote branch into yours)
从 VS 2013 提交,使用来自 TortoiseGit 的日志.发生了什么,我如何推/拉并取回我的错误提交更改?
Commited from VS 2013, using log from TortoiseGit. What happend and how do i push/pull and get back my bugged commit changes?
您的分支和origin/master"已经发生分歧,分别有 1 个和 1 个不同的提交.
Your branch and 'origin/master' have diverged, and have 1 and 1 different commit each, respectively.
要解决这种分歧",您可以执行以下操作:
To resolve that "divergence", you can do a:
git pull --rebase
git push
这将在最近的 origin/master
上重放您的提交,并允许继续推送.
That will replay your commits on top of the most recent origin/master
ones, and allows the push to proceed.