{"thread":{"id":"11481","subject":"Multiple shared repositories (including svn) workflow","startedAt":"2008-01-05T08:54:04Z","lastAt":"2008-01-05T15:07:28Z","messageCount":2,"participants":["Luke Lu","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"64514","messageId":"DA45FDDC-BEEB-47F6-A2B6-4FE4FFEF8B0D@vicaya.com","threadId":"11481","inReplyTo":null,"subject":"Multiple shared repositories (including svn) workflow","fromName":"Luke Lu","fromEmail":"git@vicaya.com","sentAt":"2008-01-05T08:54:04Z","receivedAt":"2008-01-05T08:54:04Z","isPatch":false,"sender":{"key":"git@vicaya.com","avatar":null},"body":"We have an existing project using subversion. Half of the committers  \nwant to use git for its features and speed, another half (mostly  \neditors, graphic designers etc.) want to continue use svn for the  \nusual reasons -- advanced features of git doesn't really buy them  \nmuch. They just want to work as usual, especially with the ease of  \nTortoiseSVN (some swear by it). After some thought and experiment, I  \nproposed the following workflow:\n\n0. People who want to use svn can continue using svn as usual.\n\n1. A maintainer uses git-svn to convert the subversion project into git:\n    git svn clone -s <project_url> project\n\n2. He then creates a bare git repo as the \"current\" or \"official\"  \ntree for the brave git users.\n    git clone --bare project project.git\n    project.git is then hosted on server, say, scm\n\n3. Git users clone the \"current\" repo\n    git clone git://scm/repos/project.git\n    and work merrily ever after.\n\n4. A maintainer (people or a cron job) would keep both official trees  \nsynced:\n    a. He needs to add a git remote for the git-svn repo created at  \nstep 1:\n       git remote add project ssh://scm/repos/project.git\n    b. To sync commits from git to svn:\n       git fetch && git rebase project/master\n       git svn rebase\n       git svn dcommit\n    c. To sync from svn to git:\n       git svn rebase\n       git rebase project/master\n       git push project\n\nPreliminary tests showed that it seems to work well. Any problems  \nthat I didn't foresee?\n\nAnyway, I've been using git for only a few months. There might/must  \nbe better ways to do it. As a user coming from cvs and svn, it seems  \nto me that the most confusing command is actually \"git pull\" as it  \ndoesn't work with such workflow at all (conflicts with confusing  \nmessages, until you really understand the implications of rebase). It  \nseems to me that if we create a new \"git update\" command which is  \nessentially \"git fetch && git rebase <remotebranch>\", it would  \ngreatly alleviate such confusions. Some lessons learned from the  \nshort experience:\n\n1. commit first, ask question later.\n2. rebase is the new update\n3. reset --hard and reflog are your friends.\n\nAgain, comments welcome.\n\n__Luke\n"},{"id":"64534","messageId":"m363y8nwf9.fsf@roke.D-201","threadId":"11481","inReplyTo":"DA45FDDC-BEEB-47F6-A2B6-4FE4FFEF8B0D@vicaya.com","subject":"Re: Multiple shared repositories (including svn) workflow","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-01-05T15:07:28Z","receivedAt":"2008-01-05T15:07:28Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Luke Lu <git@vicaya.com> writes:\n\n> Anyway, I've been using git for only a few months. There might/must\n> be better ways to do it. As a user coming from cvs and svn, it seems\n> to me that the most confusing command is actually \"git pull\" as it\n> doesn't work with such workflow at all (conflicts with confusing\n> messages, until you really understand the implications of rebase). It\n> seems to me that if we create a new \"git update\" command which is\n> essentially \"git fetch && git rebase <remotebranch>\", it would\n> greatly alleviate such confusions. Some lessons learned from the\n> short experience:\n> \n> 1. commit first, ask question later.\n> 2. rebase is the new update\n> 3. reset --hard and reflog are your friends.\n\nI don't remember if it would be in coming 1.5.4 release, but there\nis \"git pull --rebase\", which means fetch + rebase instead of default\nfetch + merge.\n\nHTH\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"}]}