因此,在此提供一個上下文值得一點點歷史。本地刪除分支後git fetch無法工作
我已經在我的本地分支上做了重置/重置,並將其推到origin
。
現在,是時候改變拉下到測試服務器:
git pull (or git pull --force, etc)
沒有工作,給我這個消息(S);
[email protected]:~/test.myserver.com$ git pull
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 5 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (5/5), done.
From github.com:ykgw/myrepository
+ 6ef07eb...9883f8a feature/558-add-preview-button -> origin/feature/558-add-preview-button (forced update)
Auto-merging app/api/NodesController.php
CONFLICT (content): Merge conflict in app/api/NodesController.php
Automatic merge failed; fix conflicts and then commit the result.
[email protected]:~/test.myserver.com$ git checkout master
app/api/NodesController.php: needs merge
error: you need to resolve your current index first
[email protected]:~/test.myserver.com$ git pull --force
U app/api/NodesController.php
Pull is not possible because you have unmerged files.
Please, fix them up in the work tree, and then use 'git add/rm <file>'
as appropriate to mark resolution, or use 'git commit -a'.
我終於可以切換到主站和刪除有問題的分支,但隨後git fetch
沒有表現出我想拉下乾淨的分支。我該如何讓測試服務器在repo中重新識別它?
查看該文件的衝突,解決它們並提交。然後你可以再次拉動 –
說明正確的位於底部。 '拉不可能,因爲你有沒有合併的文件。請修正它們在工作樹中,然後根據需要使用'git add/rm'來標記分辨率,或使用'git commit -a'。但這聽起來像是你之後做了一些事情,並沒有顯示出來。 –
Schwern