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

huangapple go评论48阅读模式
英文:

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

问题

当我尝试运行 repo sync 时,我收到以下错误:

信息:有一个新版本的 repo 可用
警告:repo 未跟踪远程分支,因此它将不会收到更新
repo 重置:错误:条目 'git_superproject.py' 不是最新的。无法合并。
致命错误:无法将索引文件重置为版本 'v2.16.7^0'。我没有进行任何项目或 repo 更改。

英文:

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.

答案1

得分: 1

.repo/repo/中导航并运行git status。如果有任何更改,您应该运行git checkout -f将它们丢弃,如果您不需要它们。

英文:

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.

答案2

得分: -1

警告:仓库没有追踪远程分支

本地分支与远程分支不同步,您可以设置上游并使用以下命令来更新本地:

git branch --set-upstream-to=/
git fetch upstream
git rebase upstream/local-branch

对于错误和致命错误部分,您可以重置本地分支以忽略本地更改:

git reset --hard

英文:

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

huangapple
  • 本文由 发表于 2023年4月13日 18:57:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/76004603.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定