Git version control
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 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
: 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\//firstname.lastname@example.org:/' .git/config grep url .git/config # See the change
git push gives Permission denied (publickey)
$ git push -u origin master Warning: Permanently added 'github.com,18.104.22.168' (RSA) to the list of known hosts. Permission denied (publickey). fatal: The remote end hung up unexpectedly
Follow the GitHub instructions to setup your ssh keys and add the public key to your GitHub repository.