Git development
 help / color / mirror / Atom feed
* Multiple shared repositories (including svn) workflow
@ 2008-01-05  8:54 Luke Lu
  2008-01-05 15:07 ` Jakub Narebski
  0 siblings, 1 reply; 2+ messages in thread
From: Luke Lu @ 2008-01-05  8:54 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-01-05 15:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-05  8:54 Multiple shared repositories (including svn) workflow Luke Lu
2008-01-05 15:07 ` Jakub Narebski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox