Sunday, 25 November 2012

TortoiseSVN vs TortoiseGit Introduction

This post is a comparison between TortoiseGit and TortoiseSVN. In an earlier post, we have explained what a trunk, branch and tags are, together with other related concepts. An introduction to Git concepts is available here, it is a prerequisite for this post.

Creating/Cloning A Repository

Assuming you have both TortoiseGit and TortoiseSVN installed on your PC, you can create or clone repositories to your local PC directories. Select a directory and right-click it with your mouse:


  • TortoiseGit allows you to clone an existing repository locally, or to create one from scratch.
  • For TortoiseSVN, you need to open the sub-menu to create a local repository.
  • The equivalent of Git cloning is somehow a checkout in SVN.
  • With Git, a working directory is a fully fledged Git repository (related to the original repository if it was cloned). Cloned repositories can be cloned themselves. You can create chains of repositories.
  • When using a SVN checkout, the working directory is not a SVN repository. It is only a local checkout of the corresponding repository content. One cannot perform a checkout on a checkout in SVN.
  • The export function in TortoiseSVN is about obtaining a copy of files in a repository, but without the meta-data required to record changes made to this content. In other word, this will not be a working directory from a SVN perspective. This function is also available in Git once the repository is created or cloned.
  • TortoiseSVN also offers an import function, which is typically used to import the directory structure within the local directory, into the repository. This function is seldom used. People will rather perform a check out, create directories locally, and commit them.
  • At last, TortoiseSVN offers the Repo-Browser functionality which allows one to work on/browse a repository without checking it out. That same functionality is available in TortoiseGit once the repository is created or cloned.

Sync/Update And Commit

If you right-click the Git or SVN working directory, a different set of functionalities are offered:
  • A Git Sync is a Pull and a Push at the same time (we will cover these operations later). In SVN, the corresponding operations would be Update and Commit.
  • A Git Commit registers modifications made to files in the working directory.
  • A SVN Update imports locally all code committed by other developers into the repository since you performed you last check-out or last update. In others words, it makes your local directory in sync with the repository. This method is also available in Git as Update To Revision once the repository is created or cloned.
  • A SVN Commit is the operation pushing your local directory modifications back to the repository.

Additional Commands

About commands in common:
  • Show Log - Displays the list of commits performed on the directory. 
  • Check For Modifications - Shows the list of file modifications together with files which have not been added for versioning/revision in the repository.
  • Resolve(d) - Sometimes, code conflicts between (remote) repository or branches and the local (working) directory need to be decided and resolved. It can be a matter of giving preference to the local or remote code. This functionality helps resolve this.
  • Revert - If you don't like the uncommitted modifications you have made so far to your files, you can retrieve the original version in the repository. Think at this functionality as a rubber.
  • Clean Up - If something happened while a command was performed, the system may be left in an unstable or unclean status. This command help clearing the mess.
  • Rename - Helps renaming a file or folder in the local directory. One should not use the typical windows explorer rename function, because Git and SVN would not be notified and it would be impossible for them to maintain continuity between files.
  • Delete - Removes a files or a directory in the local directory. Just like for renaming, one
    should not use the typical windows explorer delete function, because Git and SVN would not be notified and it would be impossible for them to maintain continuity.
  • Switch - Assuming you are working on trunk (SVN) or master (Git), or a branch, this method helps you shift between these back and forth, rather than checking them out in another local directory.
  • Merge -  This allows one to merge the modifications made in a branch back to trunk/master (or any other source branch it was created from).
  • Create Branch/Tag - Simply allows the creation of branches and tags.
  • Settings - Enables configuration of TortoiseGit and TortoiseSVN.
  • Add - Tells Git and SVN to take files into consideration for the next commit. In Git, this is called staging.
  • Create Patch (Serial) - This method is about creating patch from modifications made in the local directory.
  • Apply Patch (Serial) - This functionality is about applying patches to the  local directory.
  • Help - Provides documentation about TortoiseGit and TortoiseSVN.
  • About - Provides information about TortoiseGit and TortoiseSVN.
About TortoiseSVN specific commands:
  • Revision Graph - Displays a graph of branches and tags in the repository.
  • Get/Release Lock - Allows one to lock some files in the repository, to make sure no other engineer modifies them while one is working on it locally.
  • Relocate - If the repository has changed of location, this functionality has local checkout point to that new location.
About TortoiseGit specific commands:
  • Fetch - This functionality retrieves modifications from a remote source back to the local repository, but does not merge them.
  • Pull - This is a fetch with merging.
  • Push - This function pushes current modification to a remote repository.
  • Diff (With Previous Version) - Displays staged differences made in the working directory.
  • Rebase - A complex function allowing to move modifications made to a branch back to master (or any other branches), without keeping a continuity trace in the logs.
  • Stash Save - Saves current work made in the local directory without committing it into the repository.
  • Bisect Start - Helps finding a revision that caused an issue and move the HEAD pointer accordingly if necessary.
  • Submodule Add - Adds another Git project/repository in this repository, while keeping commits separated.