从强制推送中恢复git存储库

时间:2018-10-14 14:25:15

标签: git

我的git储存库有问题。基本上,我所做的就是强行推向大师(我不记得其背后的原因)。实际上,如果我退出开发,那就会导致分支分歧:

~/workspace/my-project(master*) » git pull origin development
From https://github.com/xxxx/xxxxx
 * branch            development -> FETCH_HEAD
Updating 77239c7..958a5ff
Fast-forward
 .eslintrc.js                                                         |   17 -
 .gitignore                                                           |    4 +-
// other files differences...

但是当我尝试提交时:

~/workspace/my-project(master) » git commit -a
On branch master
Your branch and 'origin/master' have diverged,
and have 430 and 20 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)

nothing to commit, working tree clean

如果我尝试从母带拉入母带,则会出现此错误:

~/workspace/my-project(master) » git pull origin master
From https://github.com/xxxx/xxxxx
 * branch            master     -> FETCH_HEAD
fatal: refusing to merge unrelated histories

我有强制推送提交的哈希值,应该怎么做才能将开发合并到master中?

0 个答案:

没有答案