All of lore.kernel.org
 help / color / mirror / Atom feed
* git subtree push could not rev-parse split hash...bug?
@ 2021-01-19 10:27 Vang Nguyen
  0 siblings, 0 replies; only message in thread
From: Vang Nguyen @ 2021-01-19 10:27 UTC (permalink / raw)
  To: git

Hi,

We have a parentRepo with a subtreeRepo. When multiple people git
subtree push from the parentRepo to the subtreeRepo origin if you
weren't the last to do the push you get the following error:

git subtree push --prefix=subtreeRepo
git@github.com:projectname/subtreeRepo.git master
git push using:  git@github.com:projectname/subtreeRepo.git master
fatal: ambiguous argument
'f7e47b631c71ccf50c46f8e762dc043bcde4e7c1^0': unknown revision or path
not in the working tree.
Use '--' to separate paths from revisions, like this:
'git command [revision...] -- [file...]'
could not rev-parse split hash
f7e47b631c71ccf50c46f8e762dc043bcde4e7c1 from commit
1ce2d3f972571df5e52e97391e0f799b6140ee5b
To github.com:projectname/subtreeRepo.git
 ! [rejected]        7411fe6059e0f7af62df52e38e647b77bcfec151 ->
master (fetch first)
error: failed to push some refs to 'git@github.com:projectname/subtreeRepo.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Makefile:675: recipe for target 'git-subtree-push-subtreeRepo' failed

The command run to do the push is:

git subtree push --prefix=subtreeRepo
git@github.com:projectName/subtreeRepo.git master

git version 2.17.1

A workaround seems to be to do a
git subtree pull --prefix=subtreeRepo
git@github.com:projectname/subtreeRepo.git master --squash
and then abort the results of the subtree pull with git reset --hard
origin/master.
The the git subtree push works fine.

The message doesn't seem to make sense since the split hash f7e47b631
and commit 1ce2d3f9 are there and it all seems like it should work.

I see that there's a ^0 at the end of the split hash in the error
message. Is that supposed to be there? fatal: ambiguous argument
'f7e47b631c71ccf50c46f8e762dc043bcde4e7c1^0'.

Regards,

Vang

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-19 18:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-19 10:27 git subtree push could not rev-parse split hash...bug? Vang Nguyen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.