[Assorted-commits] SF.net SVN: assorted:[1055] sandbox/trunk/src/git/gitsvn.bash
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-11-05 18:45:50
|
Revision: 1055 http://assorted.svn.sourceforge.net/assorted/?rev=1055&view=rev Author: yangzhang Date: 2008-11-05 18:45:41 +0000 (Wed, 05 Nov 2008) Log Message: ----------- added git svn demo Added Paths: ----------- sandbox/trunk/src/git/gitsvn.bash Added: sandbox/trunk/src/git/gitsvn.bash =================================================================== --- sandbox/trunk/src/git/gitsvn.bash (rev 0) +++ sandbox/trunk/src/git/gitsvn.bash 2008-11-05 18:45:41 UTC (rev 1055) @@ -0,0 +1,47 @@ +#!/usr/bin/env bash + +# Demo of how git svn and cloning that would work. Run this with e.g.: +# ./gitsvn.bash /tmp/test + +set -o errexit -o nounset + +# this is where the experiment will take place +basedir=$1 +mkdir -p $basedir +cd $basedir + +# set up an svn repo +mkdir svnrepo +svnadmin create svnrepo + +# add something to the repo +svn co file://$basedir/svnrepo svn +echo -e 'line1\nline2\nline3' > svn/myfile +svn add svn/myfile +svn ci -m 'added myfile' svn/ + +# git clone it +git svn clone file://$basedir/svnrepo gitsvn + +# make some more changes to svn and mirror those to gitsvn +echo -e 'line4\nline5\nline6' >> svn/myfile +svn ci -m 'added more lines' svn/ +(cd gitsvn; git svn rebase) + +# make concurrent changes to both svn and git +sed -i s/line1/Line1/ svn/myfile +sed -i s/line4/Line4/ gitsvn/myfile +svn ci -m 'munge line1' svn/ +(cd gitsvn; git commit -a -m 'munge line4'; git svn rebase) + +# clone the git repo elsewhere and commit something there +git clone file://$basedir/gitsvn gitsvn2 +sed -i s/line6/Line6/ gitsvn2/myfile +(cd gitsvn2; git commit -a -m 'munge line6'; git svn rebase) + +# make concurrent change to svn +sed -i s/line2/Line2/ svn/myfile +svn ci -m 'munge line2' svn/ + +# pull those changes back into the original git repo +(cd gitsvn; git pull file://$basedir/gitsvn2; git svn rebase) Property changes on: sandbox/trunk/src/git/gitsvn.bash ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |