Search code examples
gitgithubgit-branchgitolitemirroring

Mirroring git branch


I have a private repository on my own server hosted with gitolite. Now I want to opensource it on github, but still have one private branch.

All howtos are implying that I want to mirror whole repo with all tags and branches. But is it possible to have only common branch?

So, all I want is to keep my private branch up-to-date with public, but with some specific changes (these changes are even in separate catalog).


Solution

  • You could configure your local repository to push to both remotes.

    git remote set-url --add --push origin git://github/repo.git
    git remote set-url --add --push origin git://gitolite/repo.git
    

    Then you could push the public branch to origin.

    You could maintain your private branch separately, and push that to the gitolite remote.

    git remote set-url gitolite git://gitolite/repo.git
    

    You are free to merge or cherry pick differences between the branches.