Skip to Content »
online discount medstore
advair diskus for sale
buy advair diskus without prescription
allegra for sale
buy allegra without prescription
aristocort for sale
buy aristocort without prescription
astelin for sale
buy astelin without prescription
atarax for sale
buy atarax without prescription
benadryl for sale
buy benadryl without prescription
buy clarinex without prescription
clarinex for sale
buy claritin without prescription
claritin for sale
buy flonase without prescription
flonase for sale
buy ventolin without prescription
ventolin for sale
amoxil for sale
buy amoxil without prescription
augmentin for sale
buy augmentin without prescription
bactrim for sale
buy bactrim without prescription
biaxin for sale
buy biaxin without prescription
buy cipro without prescription
cipro for sale
buy cleocin without prescription
cleocin for sale
buy dexone without prescription
dexone for sale
buy flagyl without prescription
flagyl for sale
buy levaquin without prescription
levaquin for sale
buy omnicef without prescription
omnicef for sale
amaryl for sale
buy amaryl without prescription
buy cozaar without prescription
cozaar for sale
buy diabecon without prescription
diabecon for sale
buy glucophage without prescription
glucophage for sale
buy glucotrol without prescription
glucotrol for sale
buy glucovance without prescription
glucovance for sale
buy micronase without prescription
micronase for sale
buy prandin without prescription
prandin for sale
buy precose without prescription
precose for sale
buy cialis professional without prescription
cialis professional for sale
buy cialis soft without prescription
cialis soft for sale
buy cialis super active without prescription
cialis super active for sale
buy cialis without prescription
cialis for sale
buy levitra without prescription
levitra for sale
buy viagra professional without prescription
viagra professional for sale
buy viagra soft without prescription
viagra soft for sale
buy viagra super active without prescription
viagra super active for sale
buy viagra super force without prescription
viagra super force for sale
buy viagra without prescription
viagra for sale
buy celebrex without prescription
celebrex for sale
buy colcrys without prescription
colcrys for sale
buy feldene without prescription
feldene for sale
buy imitrex without prescription
imitrex for sale
buy inderal without prescription
inderal for sale
buy indocin without prescription
indocin for sale
buy naprosyn without prescription
naprosyn for sale
buy pletal without prescription
pletal for sale
buy robaxin without prescription
robaxin for sale
buy voltaren without prescription
voltaren for sale

Tech Life of Recht » archive for 'subversion'

 Using git to maintain Subversion branches

  • February 11th, 2009
  • 5:34 pm

I am involved in a number of projects where we use different open source projects, but for some reason, we always seem to be operating on the very edge of what these projects can actually support. Most of the time, we do not have commit access, but we’re usually more than willing to contribute patches. Because we cannot commit directly, we have to track our changes elsewhere (and some changes are not even relevant to the original project, so they should just live in our own system).

I’ve tried to use Subversion for this earlier – the Subversion book talks about how to do vendor branches. However, it has never been quite the success I wanted, somehow it was just too much trouble. Lately, however, I’ve found git to be a much better solution, because git can also be used for tracking Subversion repositories, and at the same time you get to commit changes to your local repository.

Generally, it goes like this:
[code]
git svn clone http://hudson-eclipse.googlecode.com/svn/trunk hudson-eclipse
cd hudson-eclipse
… make changes …
git add changed/file
git commit -m ‘fixed bug #34’
[/code]

Creating a patch with the last change is simple:
[code]
git format-patch -1
[/code]

This will create a file named 0001-first-line-of-commit-message, and this can then be sent upstream.

At some point, the local repository can be synced with the SVN repository by running
[code]
git svn rebase
[/code]

This command requires that no local changes are uncommitted. If you have something which has been changed, but should not be committed, you can stash it using
[code]
git stash
[/code]
After syncing, retrieve the changes again with
[code]
git stash apply
[/code]

Sometimes, conflicts occur when running svn rebase. When they do, don’t panic. If everything goes wrong, just run
[code]
git rebase –abort
[/code]

This will roll everything back to the state it was in before you started the rebase. However, you should be able to resolve the conflicts. See “git status” to check which files have conflicts. Resolve the conflicts manually, then git add each of the files. Finally, to resume rebasing, execute
[code]
git rebase –continue
[/code]

Usually, I also mirror my local repository to a public repository such as Gitorious, just to be sure everybody else can reach my changes. This will also make sure that there is always a backup of the repository.

The first time, push everything like this:
[code]
git push –all git@gitorious.org:project/mainline.git
[/code]

After that, just run this each time changes should be published:
[code]
git push
[/code]

Others can then do the usual git stuff to clone your repository:
[code]
git pull git@gitorious.org:project/mainline.git
[/code]

Finally, I recommend using “git gui” for managing commits. Using the gui, it is much easier to add separate changes in the same file to different commits. Of course, this shouldn’t be necessary, but if you’re anything like me, you sometimes forget to commit before starting on a new task.