Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git bundle from stash divergence point up to stash

Tags:

git

I want to create a git bundle that contains just the commits in my stash that aren't in the point the stash is based off of. I want to do this as opposed to sending every single commit ever made, since I know the recipient already has every commit up to and including the divergence point.

I am getting this:

$ git bundle create ehhh stash...master^1
fatal: Refusing to create empty bundle.

...which makes no sense, as git rev-list stash...master^1 returns two commits.

Am I not understanding the tool or is this a limitation?

like image 462
GNUnit Avatar asked Nov 13 '22 20:11

GNUnit


1 Answers

The problem is that the treeish stash...master^1 isn't interpreted correctly by bundle. A workaround is to create a tag:

git tag bundle_end master^1
git bundle create ehhh stash...bundle_end

Note that treeish range specifiers retrieve all commits since the beginning, not including the beginning commit itself.

like image 59
shelhamer Avatar answered Dec 09 '22 13:12

shelhamer