Moving to Git
Notes on things to look out for if a component moves from SVN to Git.
- This is a work in progress *
Start a vote
To migrate a component to git, start a VOTE by LAZY CONSENSUS on the dev ML. If the vote passes, proceed with the following steps.
Request a new Git repository
Requesting git repositories is managed by an Infra self-service which is located at http://reporeq.apache.org. Go to that website an request the new git repository. Note, that the repository name has to be the component name. So for example for Commons CLI, the repository name had to be "cli". This generated "commons-cli" as generated name.
Migrate code to new repository
- Clone the new Git repository: git clone https://git-wip-us.apache.org/repos/asf/commons-foo.git 2. Add the already existing GitHub mirror as new remote: git remote add GitHub email@example.com:apache/commons-foo.git 3. Create the master branch: git checkout -b master 4. Add all commits from the mirrored trunk branch from the GitHub mirror to the master branch: git fetch github trunk && git merge github/trunk 5. Add all other branches and tags to your local repository 6. push everything to the new repository
Update pom and website
Ensure that the SCM references in the POM and on the website are updated as soon as possible after the Git repo goes live.
Update CI builds
There are various CI builds: Jenkins, Continuum, Buildbot. These will need to be updated after the Git repo goes live
Tidy up SVN repository Tree
As part of moving a component to Git, Infra will make the current SVN tree read-only. However the files will still remain. This can cause confusion; it is easy to find the SVN files and think they are still current.
Therefore it was decided on the following process:
Once the Git repo is up and running:
1) Edit the projects data file (as below) and replace the location reference if necessary:
2) Remove the project from the svn:externals property of the trunks-proper directory:
3) Add a README file to the top level of the SVN tree for the component, e.g. math
4) Move the rest of the contents (branches,tags,trunk, etc) to
The _moved_to_git tree is read-only except as needed to move stuff into it. In order to do this, the person doing it needs to have write access to the component tree and _moved_to_git. This is controlled by the asf-authorization-template file. The entries need to look something like:
availid with the ASF login id of the person doing the move, and
xyz with the name of the component.
Sample SVN commands (using SCXML as an example)
Once the process is completed, the
asf-authorization-template should be updated to remove the temporary entries