Transfering Git repositories

  1. Create a new repository on your desired host (e.g Github, GitLab, BitBucket). It’s important to create a completely empty repository, so make sure not to select any option such as ‘Initialise this repository with a README’ or similar.

  2. Checkout the existing repository from CCPForge. It is important to use a clean copy of the repository and to use the --bare flag:

    git clone --bare ssh://username@ccpforge.cse.rl.ac.uk/gitroot/PROJECT
    cd PROJECT
    

    (see the ‘Git > Access Info’ tab of your project for the exact URL)

  3. Push the repository, including all branches and tags, to the new repository:

    git push --mirror NEW_REPOSITORY_LOCATION
    
  4. Delete the copy of the repository that you just cloned, since it is a ‘bare’ repository, not a normal working copy.

    cd ..
    rm -rf PROJECT
    
  5. Clone the new repository to start working in.

    git clone NEW_REPOSITORY_LOCATION