There is a point to this story, but it has temporarily escaped my mind...
Contact Me MyFaceBook MyLinkedIn MyGitHub MyTwitter

Integration with Subversion

I also use Git as a front-end to SVN repositories. At the most basic level, using Git as a front-end to SVN involves:

git svn clone project

To get updates from SVN:

git svn rebase

To push changes to SVN:

git svn dcommit

You should ALWAYS update from SVN or pushing changes back to SVN will fail.

Typical Work Flow

However, if that was all there was to it, there would be no reason to use Git instead of Subversion. I think that the best part of Git branching and merging. You can create as many local branches as you like with git branch branch_name or git checkout -b branch_name. You can code within these local branches as much as you want and you can merge one or more of them together. I recommend that you never “work” in the master branch other than to sync your repository with remote repositories.

One thing that you always need to do prior to merging branches into the master branch is to rebase your master branch. Rebase means to replay the commits of the named branch on top of the branch that your are currently in. It creates new commits that while they contain the same content, each commit has a different SHA1.

(master)$ git svn rebase
(master)$ git checkout -b bug81
code, code, code, ... done
(bug81)$ git checkout master
(master)$ git svn rebase        # Always rebase from SVN...
(master)$ git checkout bug81
(bug81)$ git rebase master      # Rebase changes from SVN to the bug81 branch
(bug81)$ git checkout master
(master)$ git merge --ff bug81  # Merge changes that "originated" in the bug81 branch
(master)$ git svn dcommit       # Send changes to SVN...
(master)$ git branch -D bug81   # delete the branch it is not needed anymore (Optional)
Copyright © 2019 by Julian Easterling. SOME RIGHTS RESERVED.
Privacy Policy              Terms of Use             

Creative Commons License
Except where otherwise noted, content on this site is
licensed under a Creative Common Attribution-Share Alike 4.0 International License.

All of the opinions expressed on this website are those of Julian Easterling and
do not represent the views of any of my current and previous clients or employers in any way.

If you notice an error on the site or content that has not been properly attributed, bring
it to my attention using the contact page and I will endeavor to fix it as soon as I can.

I accept no responsibility or liability for any damages incurred by following any of
my advice or by using any of the information on my site or of those sites that I link to.