简体   繁体   中英

git subtree pull rebase error

I added one repo as subtree, when I run git pull -s subtree projectB master , everything is as expected, but get fatal when switch to rebase merge with git pull --rebase -s subtree projectB master . Log:

First, rewinding head to replay your work on top of it...
fatal: Could not parse object 'd2c2b2d5548fab404e1fccfa1fc22da3d5a6151c^'
Unknown exit code (128) from command: git-merge-subtree d2c2b2d5548fab404e1fccfa1fc22da3d5a6151c^ -- HEAD d2c2b2d5548fab404e1fccfa1fc22da3d5a6151c

Any ideas?

[edit] I believe subtree depends on the tree hash remaining the same to maintain the path and rebase doesn't.

I've run into this using subtree. If your configs have rebase=true such as branch.master.rebase=true and pull.rebase=true it will defeat the subtree.

It seems there was a documentation recommendation that never got merged (this looks like a howto page you may be using)...

In my case a quick git config pull.rebase false did the trick. Tweaking git config branch.master.rebase false should help that repo sync.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM