Dropbox 冲突导致 Github 个问题
Dropbox conflict causing Github issues
呃。所以 Dropbox 刚刚给我带来了一些问题,因为它没有在应该同步的时候同步。我不知道是 merge
还是 rebase
还是别的什么。我需要一些高级的 gitfu。
我是该项目的唯一开发人员,由于在台式机和笔记本电脑之间切换而出现冲突。没有其他人使用这个回购协议......我可以从字面上擦除远程回购协议并重新开始,这会很好。 (我真的不想失去历史,但从代码 POV 来看会很好。)
运行 git push
简单地说:
To github.com:JCW/kicker-ticketing.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:JCW/kicker-ticketing.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
git status
揭示:
On branch master Your branch and 'origin/master' have diverged,
and have 6 and 3 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
nothing to commit, working tree clean
我删除了所有冲突文件(包括 .git/
中的文件并手动添加了所有代码更改)——我的本地存储库现在应该是远程 origin/master
。
在这种特殊的单机开发情况下,将我的本地存储库推送为新的远程存储库的最佳方法是什么origin/master
?
我已阅读 a few guides on rebase vs merge,但我仍然无法找到明显的解决方案。
下次我会在继续工作之前确保 Dropbox 没有崩溃。叹息
你说:
my local repo is now what should be the remote origin/master
如果您对此有把握,只需 运行 git push -f
从您的本地状态重置远程状态。这对远程端是破坏性的,所以如果你先备份它就好了。
作为独立开发者(以及在小团队中),我更喜欢使用 git pull --rebase
来始终保持线性历史记录,因为这样我可以更轻松地调试此类问题。
呃。所以 Dropbox 刚刚给我带来了一些问题,因为它没有在应该同步的时候同步。我不知道是 merge
还是 rebase
还是别的什么。我需要一些高级的 gitfu。
我是该项目的唯一开发人员,由于在台式机和笔记本电脑之间切换而出现冲突。没有其他人使用这个回购协议......我可以从字面上擦除远程回购协议并重新开始,这会很好。 (我真的不想失去历史,但从代码 POV 来看会很好。)
运行 git push
简单地说:
To github.com:JCW/kicker-ticketing.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:JCW/kicker-ticketing.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
git status
揭示:
On branch master Your branch and 'origin/master' have diverged,
and have 6 and 3 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
nothing to commit, working tree clean
我删除了所有冲突文件(包括 .git/
中的文件并手动添加了所有代码更改)——我的本地存储库现在应该是远程 origin/master
。
在这种特殊的单机开发情况下,将我的本地存储库推送为新的远程存储库的最佳方法是什么origin/master
?
我已阅读 a few guides on rebase vs merge,但我仍然无法找到明显的解决方案。
下次我会在继续工作之前确保 Dropbox 没有崩溃。叹息
你说:
my local repo is now what should be the remote origin/master
如果您对此有把握,只需 运行 git push -f
从您的本地状态重置远程状态。这对远程端是破坏性的,所以如果你先备份它就好了。
作为独立开发者(以及在小团队中),我更喜欢使用 git pull --rebase
来始终保持线性历史记录,因为这样我可以更轻松地调试此类问题。