0
我已經遇到無法檢出分支的問題(請參閱here)。我強制結帳(git checkout master -f
)並做了合併和標記後,我現在想切換到開發分支。這就是我得到:無法更改分支:因爲(已?)未跟蹤文件導致合併衝突
git checkout develop
MyProject.userprefs: needs merge
error: you need to resolve your current index first
這是git status
給出:
On branch master
Your branch is ahead of 'origin/master' by 78 commits.
(use "git push" to publish your local commits)
Unmerged paths:
(use "git reset HEAD <file>..." to unstage)
(use "git add/rm <file>..." as appropriate to mark resolution)
deleted by us: MyProject.userprefs
no changes added to commit (use "git add" and/or "git commit -a")
我在開始時文件MyProject.userprefs
,但是從刪除它發展分支,把它添加到.gitignore
。現在該文件似乎不被主分支忽略。
什麼也有趣的是,該文件似乎在指數git ls-files --stage
兩次追蹤:
100644 b16bd8d4e57de7705a5a388d045fed7376a1b175 1 MyProject.userprefs
100644 ef238f895ca1b80f10cfcd45349d82df925ff482 3 MyProject.userprefs
我應該直接刪除MyProject.userprefs?但IDE需要它。我應該在分支分支中重新創建索引嗎?