git-svn
suggest changeRemarks
Cloning really big SVN repositories
If your SVN history is very large, this operation can take hours, because git-svn rebuilds that history as Git commits. You only need to clone the SVN repository once; as with any other Git repository you can copy the folder to other collaborators. Copying the folder is quicker than cloning a large SVN repository again.
About commits and SHA1
Your local git commits will be rewritten when using the command git svn dcommit. This command will add a text to the git commit’s message referencing the SVN revision created in the SVN server, which is very useful. However, adding a new text requires modifying an existing commit’s message which can’t actually be done: Git commits are immutable. The solution is to create a new commit with the same contents and the new message, but it is technically a new commit anyway (i.e. the git commit’s SHA1 will change)
As git commits created for git-svn are local, the SHA1 ids for git commits are different between each git repository! This means that you can’t use a SHA1 to reference a commit from another person because the same SVN revision will have a different SHA-1 in each local Git repository. You need to rely on the SVN revision number appended to the commit message when you push to the SVN server if you want to reference a commit between different copies of the repository.
You can use the SHA-1 for local operations though (show or diff a specific commit, cherry-picks, and resets).
Troubleshooting
git svn rebase command issues a checksum mismatch error
The command git svn rebase throws an error similar to this:
Checksum mismatch: <path_to_file> <some_kind_of_sha1>
expected: <checksum_number_1>
got: <checksum_number_2>
The solution to this problem is reset svn to the revision when the troubled file got modified for the last time, and do a git svn fetch so the SVN history is restored. The commands to perform the SVN reset are:
- git log -1 --
<path_to_file>(copy the SVN revision number that appears in the commit message) - git svn reset
<revision_number> - git svn fetch
You should be able to push/pull data from SVN again
File was not found in commit When you try to fetch or pull from SVN you get an error similar to this
<file_path> was not found in commit <hash>
This means that a revision in SVN is trying to modify a file that for some reason does not exist in your local copy. One way past this error is to fetch while ignoring that path so the file can be updated to its state in the latest SVN revision:
git svn fetch --ignore-paths <file_path>