How to git svn fetch + rebase in one operation?

I just found that although the rebase section in git help svn says

This displays revisions of the SVN parent of the current HEAD and resets the current (not compatible with SVN) work against it.

(my emphasis) this does not mean that rebase includes a git svn fetch . Ignoring aside, is there a way to run a single git svn to execute both ?

The reason I want to do this is because I write only on one branch, so I want to rebase so that one and I often read the other branches, so I want to fetch those.

+8
git git-svn
source share
3 answers

I'm also a little surprised to hear that this is actually how he behaves. But, to answer your question, you just need to define an alias:

git config --global alias.refetch '!git svn fetch && git svn rebase'

Then git refetch should do what you want.

+8
source share

I think you are git rebase and git svn rebase . The first steps commit your current HEAD to any revision you specify, while the last moves your current HEAD to the tip of the Subversion branch you are in.

git svn rebase includes git svn fetch --parent , i.e. it will receive any new Subversion to the branch you are currently on, but no Subversion will take any other branch (contrasts with a simple git svn fetch , which extracts from all branches).

I suspect that you do not want to do a full git svn fetch when you do git svn rebase , as this will mean that there will be much more before you get a useful working copy. If you want regular git svn fetch es, I would suggest setting up a cron job that will do background fetching for you.

+19
source share
 git pull --rebase 

You can also configure it so that it changes by default. Then you can:

 git pull 

UPDATE:

oops. You need more coffee ...

All I can think of is a script what you need.

-3
source share

All Articles