1

On Github, I have forked from a repository named RepoBase to a private repository named RepoForked. I then went to create a local branch MyLocalBase on RepoBase and made 5 commits to it.

I want to now bundle these last 5 commits I made in MyLocalBase branch and unbundle them on RepoForked branch. How can I do this ?

nurabha
  • 1,152
  • 3
  • 18
  • 42
  • 1
    Couldn't you add a remote to your new fork and simply push your branch there? – VonC Jan 09 '15 at 13:27
  • @VonC RepoBase and RepoForked are cloned in different folders on my machine. MyLocalBase local branch is on RepoBase. I donot want to push anything to RepoBase. What I want to do is to take the 5 commits I made on MyLocalBase to RepoForked. For this I want to use bundles. – nurabha Jan 09 '15 at 13:31
  • @nurabha, since you have access to both repositories it seems more natural to `push` or `fetch` those commits. This can be done between two local repos just as easily as with a local and a remote. Do you have a particular reason for wanting to use `bundle`? – ChrisGPT was on strike Jan 09 '15 at 13:41
  • @Chris: I think I understand the point. So I add RepoForked as a remote branch in RepoBase and push my local branch MyLocalBase to it. Is that what you are suggesting ? – nurabha Jan 09 '15 at 13:43
  • 1
    @nurabha this is what I describe in the first part of the answer. – VonC Jan 09 '15 at 14:02

1 Answers1

3

The natural solution would be to add a remote and push:

git remote add RepoForked ../path/to/repoForked
git checkout MyLocalBase 
git push RepoForked MyLocalBase 

But, if you must use git bundle:

cd RepoBase
git bundle create file.bundle MyLocalBase

cd /path/to/RepoForked 
git remote add RepoBase /path/to/file.bundle
git fetch RepoBase
git checkout -b MyLocalBase RepoBase/MyLocalBase 

So instead of pushing directly, you would fetch from the bundle (which acts as a git repo, but presents itself as one file)

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • There is one additional thing. I want to push the 5 commits I fetched in MyLocalBase branch to RepoForked but not to RepoBase. – nurabha Jan 09 '15 at 13:57
  • @nurabha yes, what I mentioned will update repoForked from the bundle (comming from RepoBase) – VonC Jan 09 '15 at 14:02