GIT to SVN Quick Start

Installing GIT and getting started

GIT Documentation: http://git-scm.com/documentation

GIT Getting started basics: http://git-scm.com/book/en/Getting-Started-Git-Basics

GIT for Windows: http://git-scm.com/download/win

Setting up for the first time: http://git-scm.com/book/en/Getting-Started-First-Time-Git-Setup

Visual Studio 2012 Tools for Git:

Install VS2012 Update 2: http://www.microsoft.com/en-us/download/details.aspx?id=38188

Install VS Tools for GIT: http://visualstudiogallery.msdn.microsoft.com/abafc7d6-dcaa-40f4-8a5e-d6724bdb980c

 

This is a quick reference guide for using GIT accessing a Subversion source code repository.

Tools for VS2012: Getting started with git in Visual Studio 2012

Using GIT Bash from context menu:

Clone repo from SVN

git svn clone -s https://url  <local_path>

The first time (takes a long time):

git svn show-ignore > .gitignore
git add .
git commit                  (commits .gitignore)
git svn dcommit             (commits .gitignore to svn for everyone to share)

Show list of branches

git branch -a

Make changes in a branch

git branch <new_branch>      (create branch)
git checkout <new_branch>    (switch)

Add changes/edits

git add <file>           (1 file)
git add .                (all files)
git add --patch          (prompts text changes)

Commit

git commit               (commits to current branch)

Merge to master

git checkout master      (switches to master)
git merge <branch>       (merge branch into master and auto commit if no conflicts)
git commit               (if conflicts needed resolving)

Merge to svn

git svn rebase           (update from svn)
git svn dcommit          (commit to svn for all to share)

Revert

git checkout <file>      (revert individual file)
git checkout .           (revert all files)
git reset head <file>    (revert if changes have been tracked)
git reset head .         (all files)

References and further help:
http://git.or.cz/course/svn.html
http://viget.com/extend/effectively-using-git-with-subversion
http://maymay.net/blog/2009/02/24/how-to-use-git-svn-as-the-only-subversion-client-youll-need

Enjoy!

 

Posted in Development, Miscellaneous, Source Repository | Tagged , , , | Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre user="" computer="" escaped="">