I have downloaded Android source code with repo, then I made some changes in frameworks/base/packages. Now when I trying to do repo sync, it gives me this error:
Syncing work tree: 60% (151/251) error: You have local changes to
‘packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java’;
cannot switch branches.
How to fix it and upgrade all the projects that have no changes?
As Jens comments, stashing is a good option here (for uncommitted changed.
It allows to save your local modification,
git pullandgit stash applysaid modifications back.See for instance “Can’t pull or push after git clone – local changes“.
If you had already committed changes, it would be best to:
tmpbranch at your current HEADHEADtoorigin/masterrepo sync.tmptomaster