1
這是我第一次使用git(在bitbucket.org上 - 如果這有什麼區別),我提交了一些音頻文件到我顯然不想在那裏的回購。我添加然後添加路徑到.gitignore發現這隻會忽略進一步的變化。 所以我偶然發現了this SO question並試圖使用那裏提到的David Underhill's script。試圖從git中刪除文件,現在分支機構發生分歧,我無法推送更改
不過,現在我得到以下消息git commit
:
# On branch master
# Your branch and 'origin/master' have diverged,
# and have 10 and 10 different commits each, respectively.
#
nothing to commit (working directory clean)
和git push
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://bitbucket.org/abc/def'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
所以我嘗試了git push --force
其成功,但實際上並沒有改變任何東西的回購,甚至沒有出現在那裏。
你知道我該如何解決這個問題嗎?
這很奇怪。請git推-f和git狀態併發布所有輸出 –