Git and SVN¶
git-svn provides tools for bidirectional communication between a git local repository and an SVN remote server
Git often requires significantly more local storage than SVN because it is a distributed revision control system that downloads the entire repository history to each user's machine. On the other hand, SVN is a centralized system and stores the latest file revisions locally.
1. Basics¶
Preparation¶
- Install SVN, such as TortoiseSVN, including command-line tools.
- Install git
- A student can access the team's SVN repository
Clone (Check Out) a Repository¶
IMPORTANT! Use a shallow clone.
The "git svn clone" command creates a full, standalone copy of a remote SVN repository, including the entire history, every file, and all commit messages on the user's local machine. Hence, it often requires a large local storage space. RPI could block the user's IP address because of frequent and many accesses to the EDN repository.
A shallow clone in Git is a repository copy that fetches only a truncated subset of commit history. Users can clone a specific SVN version by specifying the revision number. Use the team's EDN Repository to find revision numbers.
- BAD: git svn clone --username EDNUsename RepositoyPath
- Good: git svn clone -rXXX --username EDNUsename RepositoyPath /
where XXX is an SVN revision number.
Add and Commit¶
Use git add and commit to manage files in the local repository. Provide a descriptive commit message.
Push¶
Use git-svn to push files to the SVN remote server.
- git svn dcommit
References [Accessed on July 21, 2026]¶
2. Adding a New Folder¶
The following list shows a simple method.
- Add a folder to the SVN repository using an SVN tool, such as TortoiseSVN.
- Clone the SVN folder using "git svn clone."
- Manage files using git in the local folder.
3. Visual Studio (VS) Code, Git, and SVN¶
Preparation (Windows)¶
- Install git (https://git-scm.com/install/windows)
- Install VS Code (https://code.visualstudio.com/download?_exp_download=d53503e735)
- Install the VS Code Extension called Git SVN Buttons (https://marketplace.visualstudio.com/items?itemName=taroxd.git-svn-vsix)
Operations¶
- Clone a folder from the SVN repository. See Clone (Check Out) a Repository
- Manage source files using VS Code's git interfaces.
- Use the git svn dcommit button instead of the Push button to push (commit) the file(s) to the SVN repository.
- Push files using a command terminal and "git svn dcommit" instead of the VS Code Push option.
References [Accessed on July 21, 2026]¶
- Quickstart: use source control in VS Code
- Source Control in VS Code This document contains the link to a video tutorial.