Repo sync fails with "repo is not tracking a remote branch"

3.4k Views Asked by At

When I try to run repo sync I get this error:

info: A new version of repo is available warning: repo is not tracking a remote branch, so it will not receive updates repo reset: error: Entry 'git_superproject.py' not uptodate. Cannot merge. fatal: Could not reset index file to revision 'v2.16.7^0'.

I haven't done any project or repo changes.

3

There are 3 best solutions below

0
Top4o On BEST ANSWER

Navigate to .repo/repo/ and run git status. If there are any changes, you should run git checkout -f to throw them away if you don't need them.

0
Bijendra On

You can ignore the info part and look for error messages

warning: repo is not tracking a remote branch

The local branch is not in sync with remote branch and you can set upstream and use the command to update local

 git branch --set-upstream-to=<remote>/<branch> <local-branch>
 git fetch upstream
 git rebase upstream/local-branch

For the error and fatal part, you can reset the local branch ignoring the local changes.

git reset --hard
0
cyanic On

Remove the .repo/repo directory entirely, and the next time repo runs, it will clone the client again.