我決定今天嘗試一下Git,試着學習它的分支系統是如何工作的。餿主意。我莫名其妙地在我犯下的一個分支變化的狀態得到了我自己,當我做「混帳推」我得到:完全卡在git中 - 「git push」不起作用,「git pull」也不能修復
To [email protected]:LAW/Repo.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:LAW/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拉「來解決,但我不知道爲什麼或如何解決事情。問題是,它現在不工作。我願意「混帳拉」,並得到:
"Already up-to-date."
但問題依然存在。所以我的問題是......現在是什麼?我不能推動分支,所以它基本上是死的,但互聯網沒有比「git pull」更好的建議來解決這個問題。不用說這很令人沮喪!
編輯一位評論者請求輸出「git branch -a」。有問題的分支是「PersonalSite」
* PersonalSite
master
remotes/origin/HEAD -> origin/master
remotes/origin/PersonalSite
remotes/origin/master
之前'git的pull'嘗試'git的fetch' –
@GregoryPakosz,'混帳pull'已經做一個'git fetch'。 – jamessan
請告訴我們你實際上在哪個分支上(最好編輯你的問題以顯示'git branch -a'的輸出) –