Here is a simple path of what I'm doing:
$ cd /newdir
$ git clone git@github.com:... .
$ git branch -m master github
$ git svn clone svn+ssh://... .
$ git branch -m master SVN
Then I have some scripts that do what is needed before pushing to Github.
I need the SVN and github branches because the files on both branches are the same but with different content. Before pushing files to Github I add some header. The two branches are also used to allow not all files on SVN go to Github.
All updates are from SVN branch to github branch. Occasionally I would add something on github branch that is not on SVN. I'll never send files/updates from github branch to SVN branch.
My problem 1 is that every time I do git svn fetch, a new master branch is created. How can I tell git svn fetch to use SVN local branch instead of master local branch?
After every:
$ git svn fetch
I could:
$ git checkout SVN
$ git merge master
$ git branch -d master
But does not look as a smart way of doing it.
Then I have a problem telling my local git that the local github branch is the remote/master branch at Github. The command
$ git push git@github.com:...
That worked perfectly before renaming local branches, now is not doing what I want.
So my 2 questions:
1 - Telling git svn to always use local SVN branch when getting updates from SVN server
2 - Telling git that local github branch is remote master branch at github