Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Those name and email don't relate to an actual username that is used to login to Git repository, they are being set in Git configuration, for example then , they may be set by the commands below:

Code Block
languagetext
themeFadeToGrey
titlegot config
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com

...

 This exact line then appears as the author name in every commit that John Doe makes.

It worth to mention that Git holds not only author name, but also a committer name:

...

Similarly, Git commits that made by John Doe <johndoe@example.com> Git user appears in SVN with John Doe author name.


Authors File

The authors mapping file is actually just a text file filled with SVN username - Git author pairs. Each pair maps SVN username to Git author like:

No Format
svn_user_name = Git Name <gitname@domain.name>

e.g. For example, a mapping for a user named John Doe, the mapping can be set as: may look like this:

No Format
john_doe = John Doe <john_doe@example.com>

Every SVN or Git user that makes commits either to SVN project or to mirrored Git repository is supposed to have the author mapping pair here in the authors file and each author pair must reside Each mapping pair must appear on a new line.

During SVN to Git translation, SubGit takes a SVN revision authors name and search the authors file for a match. If there is a matching line in the file - SubGit uses appropriate Git username to create commit in Git; otherwise, if there is not - SubGit will construct a Git commit author name using automatic mapping. And vice versa - during Git commit to SVN revision translate, SubGit searches the file and use appropriate SVN username to create the SVN revision; if there's no matching pair in the file - automatic mapping is used.Note, that it is possible to map two different SVN usernames to the same Git author - for cases, say, when one team member uses two identities to make commits or some SVN username was renamed some time. In such case there might be such configuration created:searches all specified authors files for a mapping pair. If the matching pair is found, SubGit uses appropriate author name. If there is no match, then SubGit generates author name according to automatic mapping rules.

It is possible to map more than one SVN username to the same Git author:

No Format
john_doe = John Doe <john_doe@example.com>

...

johndoe = John Doe <john_doe@example.com>

Every revision that was made by Revisions that are created either by john_doe or  or johndoe will be are being translated to Git commit commits with author name John Doe <john_doe@exampledoe@example.com>com>. But note However, when this Git user makes commit in Git and this commit is Git commits that are made by John Doe <john_doe@example.com> are being translated to SVN , the author on the SVN side will be set to first revision using first SVN username in authros files that matches particular Git name in the authors file. That is if those two authors mapping lines appear in the authors file in that exact order - john_doe first, then johndoe - then SVN revision author will always be set to john_doe when John Doe's Git commits are being translated to SVN – john_doe in this case.

Similarly, one SVN user username can be mapped to different Git authors, e.g.:

No Format
jdoe = John Doe <john_doe@example.com>

...

jdoe = Jane Doe <jane_doe@example.com>

...

jdoe = James Doe <james_doe@example.com>

and againAgain, every Git commit made by those authors will be translated to SVN with revision author set to jdoe; but SVN . SVN revisions made by that jdoe SVN user will always be by jdoe is always set to first matching Git user in the authors file - files – John Doe <john_doe@example.com> in this particular case.

...