CIRC's GitLab server is only accessible from UR networks, or via VPN. If you want to make your code public, you will have to use a third party git service, such as GitLab.com or GitHub.

GitLab.com has unlimited free private and public repositories.

Sharing your code

  • Create a mirror project on a 3rd party Git service
  • Clone your CIRC GitLab project
  • Add your mirror project as a remote repository
  • Push to the mirror project

Create a mirror project

You'll need a mirror project to host your code publicly. GitLab.com or GitHub are popular sites, but you can use any Git service that you can reach from the Internet.

Once you've created the project, make a note of the clone URL.

Clone your CIRC GitLab project

You can skip this step if you already have your project checked out. I prefer to use a separate clone though so I don't run into problems with having multiple remotes.

Add your mirror project as a remote repository

You should already have a remote named "origin".

$ git remote -v
origin  git@gitlab.circ.rochester.edu:rlemley/hello-world.git (fetch)
origin  git@gitlab.circ.rochester.edu:rlemley/hello-world.git (push)

With the clone URL from above, add a new remote pointing to your mirror project. In this example, I'm mirroring to GitLab.com, so I'm naming the new remote "gitlab.com".

$ git remote add gitlab.com https://jfx2006@gitlab.com/jfx2006/hello-world.git

Then to verify the new remote was added:

$ git remote -v
gitlab.com  https://jfx2006@gitlab.com/jfx2006/hello-world.git (fetch)
gitlab.com  https://jfx2006@gitlab.com/jfx2006/hello-world.git (push)
origin  git@gitlab.circ.rochester.edu:rlemley/hello-world.git (fetch)
origin  git@gitlab.circ.rochester.edu:rlemley/hello-world.git (push)

Push to the mirror project

Now we can push to the mirror project.

This will push the local "master" branch to the "master" branch at the "gitlab.com" remote.

$ git push gitlab.com master
Counting objects: 174, done.
Delta compression using up to 16 threads.
Compressing objects: 100% (96/96), done.
Writing objects: 100% (174/174), 19.48 KiB, done.
Total 174 (delta 51), reused 174 (delta 51)
remote: Resolving deltas: 100% (51/51), done.
To https://jfx2006@gitlab.com/jfx2006/hello-world.git
 * [new branch]      master -> master

You can push a different local branch.

$ git push gitlab.com alternative-python
Counting objects: 5, done.
Delta compression using up to 16 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 362 bytes, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: 
remote: To create a merge request for alternative-python, visit:
remote:   https://gitlab.com/jfx2006/hello-world/merge_requests/new?merge_request%5Bsource_branch%5D=alternative-python
remote: 
To https://jfx2006@gitlab.com/jfx2006/hello-world.git
 * [new branch]      alternative-python -> alternative-python