git bundle a range of commits

后端 未结 1 1716
情歌与酒
情歌与酒 2021-01-16 03:37

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 c

1条回答
  •  不知归路
    2021-01-16 04:00

    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)

    0 讨论(0)
提交回复
热议问题