我使用私人github回購項目作爲我唯一的開發人員。在本地重新綁定提交後推送到遠程提交
昨天,在將我最新的變化推向github之後,我決定試着用我的一些本地承諾來重新清理一些東西。我跟着Github's rebase tutorial並沒有聽從頂部的警告:
警告:它被認爲是不好的做法,衍合你已經被推到遠程倉庫提交。這樣做可能會引起git神的憤怒。
擠壓一些提交之後,我試着一推,並得到了這一點:
$ git push origin master
To [email protected]:me/my-repo.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:me/my-repo.git'
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
考慮沒有其他人已經觸及遠程回購,還有的是我的最後一次推動和重訂基期之間沒有任何變化,這是可以做,還是會有後果?
由於這是一個私人回購,並且您是唯一使用它的人,所以強行推送可能沒問題。只是不要成爲一種習慣。 :-) – peterjmag