Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Git Essentials

You're reading from   Git Essentials Create, merge, and distribute code with Git, the most powerful and flexible versioning system available

Arrow left icon
Product type Paperback
Published in Apr 2015
Publisher
ISBN-13 9781785287909
Length 168 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Ferdinando Santacroce Ferdinando Santacroce
Author Profile Icon Ferdinando Santacroce
Ferdinando Santacroce
Arrow right icon
View More author details
Toc

Using Git with a Subversion repository


Using Git as a client of Subversion can raise some confusion due to the flexibility of Git as compared to the more rigid way Subversion organizes files. To be sure to maintain a Subversion-friendly way of work, I recommend that you follow some simple rules.

First of all, be sure your Git master branch is related to the trunk branch in Subversion; as we already said, Subversion users usually organize a repository in this way:

  • a /trunk folder, which is the main folder

  • a /branches root folder, where you put all the branches, each one located in a separate subfolder (for example, /branches/feat-branch)

  • a /tags root folder, where you collect all the tags you made (for example, /tags/v1.0.0)

To adhere to this layout, you can use the --stdlayout option when you're cloning a Subversion repository:

$ git svn clone <url> --stdlayout

In this manner, Git will hook the /trunk Subversion branch to the Git master branch, replicating all the /branches and /tags branches...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £16.99/month. Cancel anytime