如何用repo强制和远程代码同步

xiaoxiao2021-02-28  113

https://zhidao.baidu.com/question/1177606109918628099.html

Android ROM开发经常使用repo sync。有时候有些project因为调试的原因做了一些改动,sync下来就和远程不同步了。 参考了repo的代码(.repo/repo/subcmds/sync.py)里有个参数: p.add_option('-d', '--detach', dest='detach_head', action='store_true', help='detach projects back to manifest revision')repo sync -d会将HEAD强制指向manifest的库,而忽略本地的改动。所以比较安全的做法是 先确认本地改动没必要保存了,确认之前不妨用分支备份一下(git checkout -b backup_branch; git add -u; git commit)

转载请注明原文地址: https://www.6miu.com/read-41438.html

最新回复(0)