git-archimport - Linux


Overview

git-archimport is a Git extension that enables the import of historical data from non-Git version control systems (VCS) into a Git repository. It provides a seamless bridge for migrating codebases from legacy systems, preserving historical context and collaboration information.

Syntax

git archimport [options] <source-vcs> <project-path> [<destination-path>]

Options/Flags

  • –author-mapping=: Maps authors from the source VCS to Git committers.
  • –branch-map=: Maps branches in the source VCS to Git branches.
  • –commit-list=: Specifies a file containing a list of commits to import.
  • –no-ff: Disables fast-forward merging for imported commits.
  • –no-notes: Skips importing commit notes.
  • –remote-name=: Sets the name of the remote repository for the imported data.
  • –squash: Compresses multiple imported commits into a single Git commit.
  • –since=: Filters commits based on a timestamp.
  • –until=: Filters commits based on a timestamp.

Examples

Import from Subversion:

git archimport svn http://example.com/svn/project /tmp/project

Import Specific Commits from a Git Repository:

git archimport git https://github.com/example/repo /tmp/repo-import commit-list.txt

Import with Author Mapping:

git archimport svn http://example.com/svn/project /tmp/project --author-mapping=author-mapping.txt

Common Issues

  • Missing Commit Meta-Data: If the source VCS lacks author or timestamp information, commits may be imported without complete meta-data.
  • Merge Conflicts: Importing commits with overlapping changesets can lead to merge conflicts.
  • Duplicate Branches: Branches with duplicate names may be imported from the source VCS, resulting in conflicts.

Integration

Integration with Git: git-archimport integrates seamlessly with Git, allowing imported data to be managed and tracked like any other Git repository.

Integration with Other VCS: git-archimport supports importing data from various non-Git VCS, including Subversion, Mercurial, and CVS.

Related Commands

  • git clone: Clones an existing Git repository.
  • git pull: Fetches and merges changes from a remote repository.
  • git merge: Merges one or more branches into the current branch.

For more information, refer to the official documentation: git-scm.com/docs/git-archimport