Skip to content

git subrepo pull/branch fails after force-pushing to remote  #541

Open
@nyanpasu64

Description

@nyanpasu64

After I rewrite and force-push to a remote, I can no longer git subrepo pull --method rebase to rebase my local branch on the new remote branch.

> git subrepo pull --method rebase 3rdparty/rtaudio
git-subrepo: Local repository does not contain 72d703e77db60c9faf31a5b78ddb272d08401065. Try to 'git subrepo fetch 3rdparty/rtaudio' or add the '-F' flag to always fetch the latest content.
> git subrepo branch 3rdparty/rtaudio/
git-subrepo: Local repository does not contain 72d703e77db60c9faf31a5b78ddb272d08401065. Try to 'git subrepo fetch 3rdparty/rtaudio' or add the '-F' flag to always fetch the latest content.

72d703e77db60c9faf31a5b78ddb272d08401065 is the latest remote commit seen from a prior fetch/pull. However I have rebased the rtaudio repository on upstream and force-pushed to the remote, removing 72d703e from the master branch. Now git subrepo pull fails, even though a regular git pull --rebase is perfectly capable of rebasing onto a force-pushed remote.

git subrepo pull --force [--method rebase] 3rdparty/rtaudio works (--method rebase is ignored), but discards all changes I made locally but haven't run git subrepo push on. If I've made the changes recently and haven't pushed them to master, I have to checkout a commit from before the changes, then cherry-pick the commits after running git subrepo pull --force. If I've already pushed the commits and don't want to force-push my local repo, git subrepo pull --force forces me to lose the changes in the process (I can try to reapply them afterwards).

Currently using git subrepo 0.4.3 (latest release, basically latest commit).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions