{"thread":{"id":"55008","subject":"git subtree push could not rev-parse split hash...bug?","startedAt":"2021-01-19T18:27:13Z","lastAt":"2021-01-19T18:27:13Z","messageCount":1,"participants":["Vang Nguyen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"414687","messageId":"CAL+53obGBFwA2bscvNF=fHkF5eLLEpL6rSZYygkob9-u1fXkHQ@mail.gmail.com","threadId":"55008","inReplyTo":null,"subject":"git subtree push could not rev-parse split hash...bug?","fromName":"Vang Nguyen","fromEmail":"mtb.vang@gmail.com","sentAt":"2021-01-19T10:27:50Z","receivedAt":"2021-01-19T18:27:13Z","isPatch":false,"sender":{"key":"mtb.vang@gmail.com","avatar":null},"body":"Hi,\n\nWe have a parentRepo with a subtreeRepo. When multiple people git\nsubtree push from the parentRepo to the subtreeRepo origin if you\nweren't the last to do the push you get the following error:\n\ngit subtree push --prefix=subtreeRepo\ngit@github.com:projectname/subtreeRepo.git master\ngit push using:  git@github.com:projectname/subtreeRepo.git master\nfatal: ambiguous argument\n'f7e47b631c71ccf50c46f8e762dc043bcde4e7c1^0': unknown revision or path\nnot in the working tree.\nUse '--' to separate paths from revisions, like this:\n'git command [revision...] -- [file...]'\ncould not rev-parse split hash\nf7e47b631c71ccf50c46f8e762dc043bcde4e7c1 from commit\n1ce2d3f972571df5e52e97391e0f799b6140ee5b\nTo github.com:projectname/subtreeRepo.git\n ! [rejected]        7411fe6059e0f7af62df52e38e647b77bcfec151 ->\nmaster (fetch first)\nerror: failed to push some refs to 'git@github.com:projectname/subtreeRepo.git'\nhint: Updates were rejected because the remote contains work that you do\nhint: not have locally. This is usually caused by another repository pushing\nhint: to the same ref. You may want to first integrate the remote changes\nhint: (e.g., 'git pull ...') before pushing again.\nhint: See the 'Note about fast-forwards' in 'git push --help' for details.\nMakefile:675: recipe for target 'git-subtree-push-subtreeRepo' failed\n\nThe command run to do the push is:\n\ngit subtree push --prefix=subtreeRepo\ngit@github.com:projectName/subtreeRepo.git master\n\ngit version 2.17.1\n\nA workaround seems to be to do a\ngit subtree pull --prefix=subtreeRepo\ngit@github.com:projectname/subtreeRepo.git master --squash\nand then abort the results of the subtree pull with git reset --hard\norigin/master.\nThe the git subtree push works fine.\n\nThe message doesn't seem to make sense since the split hash f7e47b631\nand commit 1ce2d3f9 are there and it all seems like it should work.\n\nI see that there's a ^0 at the end of the split hash in the error\nmessage. Is that supposed to be there? fatal: ambiguous argument\n'f7e47b631c71ccf50c46f8e762dc043bcde4e7c1^0'.\n\nRegards,\n\nVang\n"}]}