0

this is my situation

  1. I added a external repo using git subtree add -P dir/ externalrepo master.
  2. From there I create a branch locally (git checkout -b newbranch)
  3. Made some changes, I committed and pushed them
  4. Now I just want to add those changes to the external repo with git subtree push -P dir/ externalrepo master but this is the outcome
git push using:  externalrepo master
Enumerating objects: 24, done.
fatal: remote error: want 585cc138094f5003142f0cb5a40f0f56ecd1facf not valid
error: remote unpack failed: eof before pack header was fully read
To github.com:user/externalrepo.git
 ! [remote rejected]   88c2aa24aea0bf7d7942209f31215b003cdf5e67 -> master (failed)
error: failed to push some refs to 'github.com:user/externalrepo.git'

I dont know how to add the changes to the external repo

Mike W
  • 1,303
  • 1
  • 21
  • 31

1 Answers1

0

The issue had to do with being in a partial clone. I guess git subtree push checks all the history and given that it was a partial clone, the whole history was not available. The solution is either get all the history with git pull --unshallow or if that doesn't work try removing the partial clone filter following these steps. Or, the second option is from a different repository, one without partial cloning (it still can have sparse checkouts activated) try to do the git subtree push.

Mike W
  • 1,303
  • 1
  • 21
  • 31