I’m trying to set up a shell script (eventually to be run as a cron job) to automatically do a git svn rebase and then push the results to a github repository. Here’s what I have now:
#!/bin/sh
export PATH=/sw/bin:$PATH
cd ~/Projects/FieldTrip
git checkout svnMirror
git svn rebase
git push github svnMirror
git checkout master
git merge svnMirror
The problem is, it performs the checkout and rebase, but it doesn’t any of the steps after those ones:
$ fieldtrip_rebase.sh
Switched to branch 'svnMirror'
Current branch svnMirror is up to date.
Everything up-to-date
Switched to branch 'master'
Your branch is ahead of 'github/master' by 7 commits.
Already up-to-date.
Any idea why that may be?
Let us follow the steps and output:
you got
Switched to branch 'svnMirror'– Goodyou got
Current branch svnMirror is up to date.– Goodyou got
Everything up-to-date– Good. So you had nothing to push. Then it continues…you got
Switched to branch 'master'.Your branch is ahead of 'github/master' by 7 commits.you got
Already up-to-date.There is nothing to merge from svnMirror branch.It has done all that you wanted it to do. Note, it is master that is ahead of github/master by 7 commits and you are not pushing it.