項目merge request老是失敗,發現是有衝突,爲了解決衝突,需要在本地拿到遠程分支test上的代碼,直接git co test,會發現查看git br 時,出現head detached at xxxx的字樣。如果在此狀態進行修改代碼很容易丟失,因爲沒有本地分支保存代碼
同步遠程分支的兩個方法:
可以自定義本地branch名
git co -b newName origin/test
git co --track origin/test
項目merge request老是失敗,發現是有衝突,爲了解決衝突,需要在本地拿到遠程分支test上的代碼,直接git co test,會發現查看git br 時,出現head detached at xxxx的字樣。如果在此狀態進行修改代碼很容易丟失,因爲沒有本地分支保存代碼
同步遠程分支的兩個方法:
可以自定義本地branch名
git co -b newName origin/test
git co --track origin/test