2

I could git subtree pull successfully, but git subtree push fail on my mac book while it success in other Mac book.

This my command.

git subtree push --prefix=xxx ssh://xxxx/xxxx.git xxmaster 

It only fail on my Mac book.

/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-subtree: line 751: 50048 Done(141)               eval "$grl"
     50049 Segmentation fault: 11  | while read rev parents; do
    process_split_commit "$rev" "$parents" 0;
done
Max Chan
  • 21
  • 2
  • I upgrade my git version from 2.21.0 to 2.22.0 ``` git subtree push --prefix=xxxxx ssh://xxxx/xxxx.git xxmaster /usr/local/git/libexec/git-core/git-subtree: line 757: 91040 Done(141) eval "$grl" 91041 Segmentation fault: 11 | while read rev parents; do process_split_commit "$rev" "$parents" 0; done ``` – Max Chan Jul 16 '19 at 05:23
  • My Mac OS version 10.14.5 – Max Chan Jul 16 '19 at 05:24

3 Answers3

2

In my case downgrading git client to version 2.19.2 helped me (I had 2.26.1).

Here you can find link to binaries: https://git-scm.com/download/mac.

I think problem is related to this thread: https://lore.kernel.org/git/0F754615-C852-49D8-8E0C-DD2A00A15ED1@msys.ch/t/

0

Check your /Applications/Xcode.app/Contents/Developer/usr/bin/git and see if a later/latest version woudl be enough to fix the issue.

See "How to upgrade Git (Mac OSX)" and then try with /usr/bin/git

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I had upgrade my git version from 2.21.0 to 2.22.0, but it not work. – Max Chan Jul 16 '19 at 05:23
  • ``` git subtree push --prefix=xxxxx ssh://xxxx/xxxx.git xxmaster /usr/local/git/libexec/git-core/git-subtree: line 757: 91040 Done(141) eval "$grl" 91041 Segmentation fault: 11 | while read rev parents; do process_split_commit "$rev" "$parents" 0; done ``` – Max Chan Jul 16 '19 at 05:26
  • @MaxChan check that git version does return 2.22 though. If the issue persists, that might be a bug to report on the Git mailing list (https://stackoverflow.com/a/10733251/6309). – VonC Jul 16 '19 at 06:29
0

I have the same problem. finally I found the reason of it. When I split a folder to other repo and use subtree to add it, it have some commit merged in master. We can't rebase master code and only can merge. So here's the problem.

finally I solved the problem through force update master.

  • git checkout master && git pull --rebase
  • find the commit where you begin split. if it is 6cf0cb1f
  • git reset --hard 6cf0cb1f
  • cherry-pick all commit above 6cf0cb1f except the two split commit(which can delete the subtree added)
  • make sure the code and the content of commit is not change. only git graph changed
  • split it from now and use subtree add and merge to master quickly
Siyi Guo
  • 23
  • 1
  • 4