threads / discuss / 11481

Multiple shared repositories (including svn) workflow

Subject: Multiple shared repositories (including svn) workflow

## tl;dr

2 messages between Jan 5, 2008 and Jan 5, 2008.

replies: 1people: 2as markdown or json

Luke Lu· Jan 5, 2008, 08:54 UTC · lore

We have an existing project using subversion. Half of the committers want to use git for its features and speed, another half (mostly editors, graphic designers etc.) want to continue use svn for the usual reasons -- advanced features of git doesn't really buy them much. They just want to work as usual, especially with the ease of TortoiseSVN (some swear by it). After some thought and experiment, I proposed the following workflow:

0. People who want to use svn can continue using svn as usual.
1. A maintainer uses git-svn to convert the subversion project into git:
    git svn clone -s <project_url> project
2. He then creates a bare git repo as the "current" or "official"  
tree for the brave git users.
    git clone --bare project project.git
    project.git is then hosted on server, say, scm
3. Git users clone the "current" repo
    git clone git://scm/repos/project.git
    and work merrily ever after.
4. A maintainer (people or a cron job) would keep both official trees  
synced:
    a. He needs to add a git remote for the git-svn repo created at  
step 1:
       git remote add project ssh://scm/repos/project.git
    b. To sync commits from git to svn:
       git fetch && git rebase project/master
       git svn rebase
       git svn dcommit
    c. To sync from svn to git:
       git svn rebase
       git rebase project/master
       git push project

Preliminary tests showed that it seems to work well. Any problems that I didn't foresee?

Anyway, I've been using git for only a few months. There might/must be better ways to do it. As a user coming from cvs and svn, it seems to me that the most confusing command is actually "git pull" as it doesn't work with such workflow at all (conflicts with confusing messages, until you really understand the implications of rebase). It seems to me that if we create a new "git update" command which is essentially "git fetch && git rebase <remotebranch>", it would greatly alleviate such confusions. Some lessons learned from the short experience:

1. commit first, ask question later.
2. rebase is the new update
3. reset --hard and reflog are your friends.
Again, comments welcome.
__Luke
Jakub Narebski· Jan 5, 2008, 15:07 UTC · re: Luke Lu · lore

Re: Multiple shared repositories (including svn) workflow

Luke Lu <git@vicaya.com> writes:
Show 13 quoted lines
> Anyway, I've been using git for only a few months. There might/must
> be better ways to do it. As a user coming from cvs and svn, it seems
> to me that the most confusing command is actually "git pull" as it
> doesn't work with such workflow at all (conflicts with confusing
> messages, until you really understand the implications of rebase). It
> seems to me that if we create a new "git update" command which is
> essentially "git fetch && git rebase <remotebranch>", it would
> greatly alleviate such confusions. Some lessons learned from the
> short experience:
> 
> 1. commit first, ask question later.
> 2. rebase is the new update
> 3. reset --hard and reflog are your friends.

I don't remember if it would be in coming 1.5.4 release, but there is "git pull --rebase", which means fetch + rebase instead of default fetch + merge.

HTH
-- 
Jakub Narebski
Poland
ShadeHawk on #git

← back to recent threads