Android repo sync error??

Today I tried re-syncing my gingerbread code to the latest version
so I fired


$ repo sync

And lo! I got the error message:

error: .repo/manifests/: contains uncommitted changes

After a bit of googling and going through the mailing lists, I finally found the solution:

1. Go to ./repo/manifests
2. $ git reset –hard
3. $ repo sync

[Please note that there are two dashes “- -” before ‘hard’]
And I am back in business.

20 Comments

  1. Thanks! This helped me out. This entry is one of the top google results when I googled for a solution. repo sync’ing works once again.

    Reply

  2. Thanks for the help. Just one thing i’d like to note: I don’t know if it’s just a typo, or if there’re different versions which are using different arguments. But instead of ‘git reset -hard’, i needed to use ‘git reset –hard’ (prefixing hard option with two dash-characters).

    Reply

  3. Thanks this worked for me too.. can you explain how it fixed the issue and what was the reason, I never touched this folder though. Thanks.

    Reply

    1. Hi William, repo is basically a wrapper over git but it has also few custimizations of its own. Manifests are the folders where the information about the source tree is stored.
      In case you have modified any source file (even a blank space) and you want to run ‘repo sync’ which is essentially a ‘git pull’, it will fail as your tree has changes. So what we do is forcefully ‘reset’ the git’s head (the ‘hard’ keyword) to current remote master or any branch you’re on and sync again.

      If you still have a doubt check out the following link.

      http://source.android.com/source/version-control.html

      Reply

  4. I am glad I came across this blog post, as I often get errors when syncing saying that I have uncommitted changes, even when I haven’t modified any files.

    Usually I delete all the folders accept the .repo folder, then delete the default.xml manifest file.
    Then do “repo init -u git://github.com/…../manifest.git -b kitkat <—I can't reveal my private repo for the BEST ROM EVER… to be released soon… see my blog!!!
    So thank you very much for this post because, git reset –hard && ../repo sync is much easier and will sync a bit faster than my way! Thanks again!

    Reply

  5. When a individual car or truck is chosen by a person the program will exhibit which auto
    sections have presently been marketed relating to the car or truck.
    Top rated auto body part repairing, installation and paint service for
    competitive price. It is a phony citation that you can use to play a joke
    on someone.

    Reply

Leave a comment