Skip to content

Can't commit: 'subrepo/xxxxxx' doesn't contain upstream HEAD: yyyyyy (again, sorry) #632

@n3dst4

Description

@n3dst4

I'm aware that this class of error has been reported multiple times, but I keep running into it so I'm sure I'm doing something wrong. I have tried to create a minimal repro, but it works fine there, which is vexing. Luckily all my repos are public which might help with debugging.

I have a project repository, which is here: https://github.com/n3dst4/gumshoe-fvtt

Inside it, under packages/shared-fvtt-bits, is a subrepo clone of some stuff I reuse between projects: https://github.com/n3dst4/shared-fvtt-bits

The shared-fvtt-bits repo/subrepo gets commited to directly and via my project repo (and potentially other projects using it as a subrepo). I believe that this is a reasonable use-case for subrepo, right? So Im expecting to see merge commits, and occasionally having to deal with conflicts.

git subrepo pull packages/shared-fvtt-bits usually seems to work fine.

Every time I attempt to git subrepo push packages/shared-fvtt-bits I get the Can't commit: 'subrepo/xxxxxx' doesn't contain upstream HEAD: yyyyyy error.

I have not rewritten history on my main branch. I have also not rewritten history in the shared repo.

The .gitrepo file after a successful pull looks like:

[subrepo]
	remote = [email protected]:n3dst4/shared-fvtt-bits.git
	branch = main
	commit = b6db2c1a6c1523fc6af5121e2ffa6bca0714c732
	parent = 2a49ef8d9fd8579b7cce16a1be14f1afd6c2de40
	method = merge
	cmdver = 0.4.9

The commit hash b6db2c1a6c1523fc6af5121e2ffa6bca0714c732 is indeed the correct, real hash of the HEAD of shared-fvtt-bits.

The parent hash 2a49ef8d9fd8579b7cce16a1be14f1afd6c2de40 is the hash of the most recent commit on my main branch before the last time time I successfully pulled (that time, I was in a hurry so I just force-pushed the subrepo - this time I'm asking for help!)

The exact error I'm seeing is:

git-subrepo: Can't commit: 'subrepo/packages/shared-fvtt-bits' doesn't contain upstream HEAD:  b6db2c1a6c1523fc6af5121e2ffa6bca0714c732

Question: after a successful git subrepo pull, what should parent and commit be pointing to?

Edit: I also note that after the error, looking at the branch that subrepo has created, the hashes of the most recent commits from the shared repo are all wrong, as if they've been rebased. The HEAD commit of the shared repo (b6db2c...) is now 60956... for example.

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