artem
artem

Reputation: 16777

How to sync android repo after making changes?

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?

Upvotes: 1

Views: 4303

Answers (1)

VonC
VonC

Reputation: 1324268

As Jens comments, stashing is a good option here (for uncommitted changed.
It allows to save your local modification, git pull and git stash apply said 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:

  • make a tmp branch at your current HEAD
  • reset HEAD to origin/master
  • re-try the repo sync.
  • merge tmp to master

Upvotes: 4

Related Questions