paint-brush
How to Use Git With SVN: Harmonizing Version Controlby@kaiser937426
182 reads

How to Use Git With SVN: Harmonizing Version Control

by KaiserFebruary 6th, 2024
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

TortoiseSVN and Git can work independently without conflict. Use these steps to set up your project to use both versions control systems. You can use Git during development while still adhering to your company's version control regulations. For more information on how to use Git with SVN, see the Git and SVN guide.
featured image - How to Use Git With SVN: Harmonizing Version Control
Kaiser HackerNoon profile picture

If you're familiar with Git's powerful features and prefer using it for your development process, but your company uses SVN (specifically TortoiseSVN) for version control, you might wonder if you can use both. Good news: you can. They can work independently without conflict. We'll guide you on how to use Git alongside SVN.

The 4 Steps to Follow

  • Step 1: Checkout Project with SVN:
    • Start by checking out the project from SVN. Once you've done this, you will notice a .svn hidden folder in your project directory. This is where SVN keeps track of its version control information.


  • Step 2: Initialize Git:
    • Navigate to the root of your project directory using your terminal, and initiate a Git repository by running the git init command. This creates a .git hidden folder, where Git stores its version control information.


  • Step 3: Configure Git to Ignore SVN:
    • Create a .gitignore file in your project root directory to instruct Git to ignore certain files. To do this, use the touch .gitignore command, and open it for editing. Add /.svn/ to the .gitignore file. This line tells Git to ignore the SVN version control files. You can check for success with the command git status --ignored.


  • Step 4: Configure SVN to Ignore Git:
    • Similarly, you need to tell SVN to ignore Git's version control files. To do this, add the .git folder and the .gitignore file to SVN's ignore list. This can be done through the TortoiseSVN context menu. Refer to Figures 1 and 2 for detailed steps.



Now, you have successfully set up your project to use both Git and SVN simultaneously, each ignoring the version control files of the other. You can now enjoy the features of Git during development while still adhering to your company's version control regulations.


Also published here