0
我有一個mu源代碼樹的問題。當我在做某件事時,我的Mac崩潰了,並自動將它推送到我的回購中的某個分支。Mac崩潰時的源代碼樹問題
當我重新啓動我的mac我的主分支從這個本地回購中失蹤。
每當我試着提交更改,所以我可以換到不同的分支,我得到如下:
git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree commit -q -F /var/folders/fz/vqrlp05n24gcr0vdp92qyvfjvzfz2f/T/SourceTreeTemp.AlvKt1
error: unable to resolve reference HEAD: No such file or directory
fatal: cannot lock HEAD ref
Completed with errors, see above
它實際上不會犯什麼。
當我嘗試改變分支我得到:
git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree checkout 83382244_Sign_In_Person_Button_-_Update
error: Your local changes to the following files would be overwritten by checkout:
file1
file2
file3
file4
Please, commit your changes or stash them before you can switch branches.
Aborting
Completed with errors, see above
而且這是不會改變的分支。
如果我試圖創建一個分支我越來越:
git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree branch test
fatal: Failed to resolve HEAD as a valid ref.
Completed with errors, see above
當我在終端我得到以下運行git reset HEAD
:
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
,當我運行git checkout master
我得到:
warning: ignoring broken ref refs/heads/master.
error: Your local changes to the following files would be overwritten by checkout:
file1
file2
file3
file4
Please, commit your changes or stash them before you can switch branches.
Aborting
我很爲難:/
聽起來最簡單的事情就是對本地文件進行備份,然後從您的倉庫中重新簽出項目。有可能是一種奇特的方式來解決這個使用各種git命令,但重新創建它可能會是最簡單的解決方案 – 2014-12-03 12:52:58
是的,我認爲,問題是如果我做一個browser.plist和hostingservices.plist備份它只會重現問題不是嗎?我在網上某處讀到它可能是一個損壞的文件,儘管我的所有文件都可以打開完全正常:/ – Timothy 2014-12-03 13:33:28
我不確定你的意思是「browser.plist」,但是如果你刪除了你的本地項目(或者將它移動到臨時空間),然後從遠程倉庫重新簽出,那麼項目應該處於良好狀態。然後,您可以重新創建您的更改(即將修改後的文件複製回來),它應該可以工作。 – 2014-12-03 13:37:23