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.

Advertisements

18 Responses to “Android repo sync error??”

  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.

  2. Can you explain about sysfs in android

  3. The sysfs in android is no different than native Linux sysfs
    Download and read the pdf in the linux mentioned below.

    http://www.kernel.org/pub/linux/kernel/people/mochel/doc/papers/ols-2005/mochel.pdf

  4. If you still have a doubt, ask.

  5. Pradeep M Says:

    Thanks for the help man.

  6. You’re welcome 🙂

  7. Stephan Says:

    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).

  8. 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.

    • 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

  9. The Corsican Hacker Says:

    Much appreciated

  10. 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!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: