GIT

Best practice in science is to use version control when doing any programming. To use Git version control, go to the root directory of your folder of interest and create a new repository with:

git init

You can read more about this workflow with the GitHub interactive tutorial and the Software Carpentry lesson.

git push gives fatal: HTTP request failed

GitHub recommends using HTTPs when pushing to their repo. However on the HPC Cluster, this returns an error:

$ git push -u origin master error: The requested URL returned error: 403 Forbidden while accessing https://github.com/<username>/<repo>.git/info/refs fatal: HTTP request failed

To get around this, one should instead use git@ instead of https:// and : instead of the trailing / in github.com. You can do both these things but just running this command in the root of your git repo:

sed -ie '/url[ \t]*=[ \t]*/s/https:\/\/github.com\//git@github.com:/' .git/config grep url .git/config # See the change

 

Alternatively, when cloning the repository just use ssl instead:

git push gives Permission denied (publickey)

Follow the GitHub instructions to setup your ssh keys and add the public key to your GitHub repository.