轉自:https://blog.csdn.net/u012637313/article/details/48028161
repo sync時出現類似error: bootable/: contains uncommitted changes這樣的錯誤提示,從字面意思上看是代碼有改動但是沒有commit,解決方法:
方法1.進入cd <路徑>,如上就是cd bootable/, 運行git stash(備份當前的工作區的內容,從最近的一次提交中讀取相關內容,讓工作區保證和上次提交的內容一致。同時,將當前的工作區內容保存到Git棧中。) 後在運行git clean -d -f來還原改動記錄。然後再repo sync就可以了。
方法2.repo forall -c "git reset --hard && git clean -fd && githttps://blog.csdn.net/u012637313/article/details/48028161?utm_source=copy pull"
repo forall -c
這個命令會遍歷當前路徑下所有的git倉庫,並在每個倉庫執行-c所指定的命令(這個被執行的命令就不限於僅僅是git命令了,而是任何被系統支持的命令,比如:ls 、 pwd 、cp 等等的 )