git


git is a version control scheme like svn or cvs.

Basics

checking out a git.ligo repository: git clone git@git.ligo.org:sylvia.biscoveanu/parambul8er.git
Enter ssh-keygen password for eric.thrane password stored on git.ligo.org.
Update: After updating to Mac OS 10.15.6 Catalina, I lost command line access to git. Following advice from collaborators, I installed git-lfs:
sudo port install git-lfs
This enabled me to access git again from the command line. However, I received a password prompt for every single file. I checked the web for how to get rid of that. Apparently, I need to switch my git commands to look like this:
git lfs clone git@git.ligo.org:publications/O3/o3-pop.git
That seems to get rid of the password prompts.

Check out a repository with git: git clone albert.einstein@severname/repo.git
from git hub: git clone https://github.com/tcallister/spotlightFollowup.git
to get the latest changes: git pull
to commit your own changes:
First: "git pull" to get other updates. (If you don't do this first, and there are conflicts, you will not be allowed to commit.)
Second: "git commit" to locally commit files. You're not done yet, though.
Third: "git push" to actually send the locally committed files to the repository.
In order to see what needs to be git committed, type "git status" from the parent directory. Everything labeled "modified" needs to be committed. free private repositories on git hub: https://education.github.com/guide/private_repos
Use your university email account.

Managing SSH Keys

If you are invited to join a colleagues git repository, you may receive a message like the following when you attempt to clone:
  git clone git@gitmaster.atlas.aei.uni-hannover.de:horizon/horizon_text.git
  Cloning into 'horizon_text'...
  The authenticity of host 'gitmaster.atlas.aei.uni-hannover.de (130.75.116.218)' can't be established.
  RSA key fingerprint is 09:44:a4:e3:8c:c8:90:0a:7a:13:79:6c:dd:60:56:1c.
  Are you sure you want to continue connecting (yes/no)? yes
  Warning: Permanently added 'gitmaster.atlas.aei.uni-hannover.de,130.75.116.218' (RSA) to the list of known hosts.
  Permission denied (publickey).
  fatal: Could not read from remote repository.
  Please make sure you have the correct access rights and the repository exists.
Or...
  bash-3.2$ git clone git@bitbucket.org:thebestsearch/tbs_scripts.git
  Cloning into 'tbs_scripts'...
  Permission denied (publickey).
  fatal: Could not read from remote repository.
  Please make sure you have the correct access rights
  and the repository exists.
These messages may indicate that you need to supply an ssh key. The first step is to see if you already have an ssh key with: cat ~/.ssh/id_rsa.pub. If this file does not exist, you need to create an ssh key with ssh-keygen. Once the ssh key exists, log on to the web page hosting the repository. The system is different on every hosting service, but on bitbucket, click on the little person icon > Settings. From there, click on Security > SSH Keys. Now, you will have an opportunity to paste in your ssh key. The cleanest way to do it is: cat ~/.ssh/id_rsa.pub | pbcopy. (That's a neat trick for copying text from a file into your copy/paste buffer.) Paste in the ssh key, click "add," and you should be able to clone.

Controlling access to git repositories

These instructions are geared for git.ligo.org. First, navigate to the project you want to share/hide. You can navigate to projects by clicking on your name in the upper lefthand corner. Then the projects will appear on the bottom of the page; click on the project to share. Second, once you have clicked on your project, a little gear icon (representing settings) will appear on the top-right part of the page. Click on the gear and select "Settings." Now, you can change your visibility level to Private, Internal, or Public.

Debugging

How do I get rid of this git clone error?
fatal: unable to access 'https://versions.ligo.org/git/lalsuite.git/': Protocol https not supported or disabled in libcurl
Answer: unset LD_LIBRARY_PATH

Updating Cardiff's git repository on pcdev2:
unset LD_LIBRARY_PATH
git config --global user.name "Eric Thrane"
git config --global user.email "eric.thrane@ligo.org"
LIGO_USER=eric.thrane
git config --global alias.auth '!ecp-cookie-init LIGO.ORG https://gravity.astro.cf.ac.uk/git/secure/ '${LIGO_USER}''
git auth
git pull


Back to Resources