【发布时间】:2015-12-14 07:49:01
【问题描述】:
我有一个与我的问题最接近的问题,但无法添加评论。
git: Your branch and 'origin/master' have diverged - how to throw away local commits?
我运行了上述问题的提示和答案,但没有任何决定。我正在使用软件源代码树跟踪进度表。我关闭软件并在 bash git 中运行命令。但是引用了同样的错误。
# Your branch and 'origin/master' have diverged,
# and have 7 and 11 different commits each, respectively.
# (use "git pull" to merge the remote branch into yours)
我也面临同样的问题。按照运行 2 条评论但未成功的步骤操作。我认为我的问题是,在我为个人头结帐之前,在个人头中进行提交,然后我回到树枝/主人,并提交我所做的,我相信引用了树头个人。总之,我无法撤消此提交,我在 SourceTree 软件上以图形方式显示
编辑 - 添加信息: 我想放弃未发布的提交并进行服务器结帐。但是我发现互联网无法正常工作的解决方案。我还在 gitBash 中尝试了 git reverse 控制台显示我做 deveo 的消息
$ Git status
On branch processos_criminais_151029
Your branch and 'origin / processos_criminais_151029' have diverged,
and 7 and 11 have different commits each, respectivamente.
(use "git pull" to merge the remote branch into yours)
Changes not staged for commit:
(use "git add <file> ..." to update what will be committed)
(use "git checkout - <file> ..." to discard changes in working directory)
我尝试了这两种解决方案,但都没有奏效。如果我尝试 push 会产生大量文件的冲突,并且我尝试通过自动合并来解决这些问题,但是为了创建一个新的 git status,他指出相同的 quantidde 文件是冲突的。
【问题讨论】:
-
“但没用”——它们是怎么没用的,
git status的输出在运行git reset --hard origin/master后是否保持不变? -
你到底想做什么。你预计 repo 的最终状态是什么?
-
我想放弃未发布的提交并进行服务器结帐。但是我发现互联网无法正常工作的解决方案。
标签: git git-commit git-reset