git常見問題解決

記錄在開發過程中遇到的git問題,邊解決問題邊學習,常見的命令後續找時間再補充,儘量寫一個完整的教程。

git處理衝突

當拉取下來的文件與本地修改的文件有衝突,先提交你的改變,或者先將你的改變暫時存儲起來

1、將本地修改存儲起來

git stash

2、pull內容

 git pull

3、還原暫存的內容

git stash pop stash@{0}

也可以簡寫

git stash pop

參考:https://www.cnblogs.com/wteam...

git另一個進程還在運行

問題描述

出現這種情況可能是git在執行的過程中,你中止之後異常,進程一直停留

Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.

問題原因

因爲進程的互斥,所以資源被上鎖,但是由於進程突然崩潰,所以未來得及解鎖,導致其他進程訪問不了。

問題解決

打開隱藏文件夾選項,進入工作區文件目錄的隱藏文件.git,把其中的index.lock問價刪除掉

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章