{"id":1600,"date":"2018-12-13T16:45:56","date_gmt":"2018-12-13T16:45:56","guid":{"rendered":"http:\/\/ri.itservices.manchester.ac.uk\/csf3\/?page_id=1600"},"modified":"2026-02-12T15:32:11","modified_gmt":"2026-02-12T15:32:11","slug":"git","status":"publish","type":"page","link":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/software\/tools\/git\/","title":{"rendered":"git &#038; git-lfs"},"content":{"rendered":"<h2>Overview<\/h2>\n<p>Git is a version control system, which allows you to keep old versions of files and directories (usually source code), keep a log of who, when, and why changes occurred, etc.,<\/p>\n<p>From October 2025, version 2.47.3 is the system-wide default (if you  load no modulefile.) Hence it is no longer necessary to load a modulefile, unless you specifically need an older version! <\/p>\n<p><a href=\"https:\/\/git-lfs.github.com\">git-lfs<\/a> Git Large File Storage (LFS) replaces large files such as audio samples, videos, datasets, and graphics with text pointers inside Git, while storing the file contents on a remote server like GitHub.com or GitHub Enterprise. As of December 2025, Git-LFS version 3.6.1 is the system wide default, so a module does not need to be loaded.<\/p>\n<p>If you require a different version to the one installed we advise that you install it in your home directory.<\/p>\n<h2>Restrictions on use<\/h2>\n<p>All users of the system can access the software.<\/p>\n<h2>Set up procedure<\/h2>\n<div class=\"warning\">\nNote that long-time users of the CSF may need to edit your <code>~\/.gitconfig<\/code> or <code>~\/.ssh\/config<\/code> files to remove old, proxy-related config (see below.)\n<\/div>\n<p>We recommend using the newer, system-wide version of git by NOT loading any modulefiles. This gives you immediate access to version 2.43.5 (note &#8211; if we install newer versions of git, we will revert back to providing them via modulefiles.)<\/p>\n<pre>\r\n# No modulefile loaded\r\n<em>you have access to git 2.47.3<\/em>\r\n<em>you have access to git-lfs 3.6.1<\/em>\r\n\r\n# Or load one of the following modulefiles\r\nmodule load tools\/gcc\/git\/2.43.0\r\nmodule load tools\/gcc\/git\/2.24.0\r\n<\/pre>\n<p>To use git-lfs use:<\/p>\n<pre>\r\nmodule load tools\/bintools\/git-lfs\/2.8.0\r\n<\/pre>\n<h2>Running the application<\/h2>\n<h3>Don&#8217;t clone into scratch<\/h3>\n<p>We strongly recommend that you clone repositories into your <em>home area<\/em>, or other research data storage, NOT your scratch area.<\/p>\n<p>This is because the scratch clean-up policy can automatically delete files not accessed for at least 3 months. A cloned repository often contains many files that you might not access and so the scratch clean up could remove files without you being aware of it.<\/p>\n<h3>Usage<\/h3>\n<p>On the command line type <code>git<\/code>.<\/p>\n<p>If you wish to prepare a repository for use with git-lfs run the following inside each repository:<\/p>\n<pre>\r\ngit lfs install\r\n<\/pre>\n<h3>External Access using https:\/\/<\/h3>\n<p>You can run your commands directly on the login node, or on a compute node (via <code>srun<\/code>), or in a batch job. For example:<\/p>\n<p>From the login node or in a jobscript:<\/p>\n<pre>\r\ngit clone https:\/\/github.com\/myproject.git\r\n<\/pre>\n<p>Or, from an interactive session on a compute node:<\/p>\n<pre>\r\n# On the login node, request an interactive session\r\nsrun -p interactive -t 0-1 --pty bash\r\n  #\r\n  # Wait until you are logged in to a compute node\r\n\r\n# Now run your commands as normal\r\ngit clone https:\/\/github.com\/myproject.git\r\n<\/pre>\n<p>Note: If you get an error about the web-proxy, please edit your <code>~\/.gitconfig<\/code> file:<\/p>\n<pre>\r\ngedit ~\/.gitconfig\r\n  #\r\n  # Remove 'proxy' line from the [http] section\r\n  [http]\r\n  proxy = http:\/\/<em>some.proxy.addr<\/em>:3128\/       # <strong>REMOVE THIS LINE FROM YOUR ~\/.gitconfig FILE<\/strong>\r\n<\/pre>\n<p><strong>Note:<\/strong> You may also need to remove some old config from your <code>~\/.ssh\/config<\/code> file if using the <code>ssh:\/\/<\/code> protocol (<a href=\"#key\">see below<\/a>)<\/p>\n<p>Once cloned, you may wish to work with a specific tag:<\/p>\n<pre>\r\n# List all tags (and those matching a pattern)\r\ngit tag\r\ngit tag --list v2*\r\n\r\n# Work with a specific tag\r\ngit checkout <em>tagname<\/em>\r\n\r\n# Display which tag you're on\r\ngit describe --exact-match --tags\r\n<\/pre>\n<h3 id=\"pat\">External Access to github.com using https:\/\/ (with Personal Access Tokens)<\/h3>\n<p>Github are moving away from using <code>https:\/\/<\/code> with passwords to access your repos. Their <a href=\"https:\/\/github.blog\/2020-12-15-token-authentication-requirements-for-git-operations\/\">blog post<\/a> says:<\/p>\n<blockquote><p>If you are using a password to authenticate Git operations with GitHub.com today, you must begin using a personal access token over HTTPS or SSH key by August 13, 2021, to avoid disruption.\n<\/p><\/blockquote>\n<p>See their documentation on how to <a href=\"https:\/\/docs.github.com\/en\/authentication\/keeping-your-account-and-data-secure\/creating-a-personal-access-token\">create a Personal Access Token<\/a> (this is similar to a random, expiring password.) <\/p>\n<h3 id=\"key\">External Access to github.com using ssh:\/\/ (with key)<\/h3>\n<p>An alternative to using Personal Access Tokens with <code>https:\/\/<\/code> is to set up a public-private key-pair for your github.com account, which will give you password-less access to github.com via <code>ssh:\/\/<\/code>.<\/p>\n<p>The following is a quick summary of how to setup <code>ssh:\/\/<\/code> access to github on the CSF using a key-pair:<\/p>\n<pre>\r\n# If not already done so, create a key-pair on the CSF:\r\nssh-keygen -t ed25519 -C your&#46;ema&#105;&#108;&#64;&#109;&#97;&#110;&#99;&#104;&#101;&#115;&#x74;&#x65;&#x72;&#x2e;&#x61;&#x63;&#x2e;&#x75;&#x6b;&#x2e;&#x63;&#x6f;&#x6d; -f ~\/.ssh\/id_github\r\n  #\r\n  # We recommend protecting your key with a passphrase when asked, but this is optional.\r\n  # If you intend to run git from batch jobs, do not set a passphrase.\r\n\r\n# Now edit your ~\/.ssh\/config file and add the following:\r\ngedit ~\/.ssh\/config\r\n\r\n# <strong>ADD<\/strong> the following config to make ssh:\/\/ use your key\r\nHost github.com\r\n  IdentityFile ~\/.ssh\/id_github\r\n  IdentitiesOnly yes\r\n\r\n  # <strong>REMOVE<\/strong> any old config if present\r\n  # HostName nataas.itservices.manchester.ac.uk\r\n  # IdentityFile \/mnt\/iusers01\/support\/mbexegc2\/.ssh\/id_ed25519\r\n  # StrictHostKeyChecking  no\r\n  # Port 2022\r\n\r\n(save the file)\r\n\r\n# Now look at the public key-file contents (we'll need the displayed line shortly):\r\ncat .ssh\/id_github.pub\r\nssh-ed25519 AAA................... y&#111;&#x75;&#x72;&#x2e;e&#109;&#97;&#x69;&#x6c;&#64;&#109;&#97;&#x6e;&#x63;he&#115;&#x74;&#x65;&#x72;&#46;&#97;&#x63;&#x2e;&#x75;k\r\n<\/pre>\n<p>Now login to your <a href=\"https:\/\/www.github.com\">github.com<\/a> account as normal.<\/p>\n<ol>\n<li>Then go to your <code>Account Settings<\/code><\/li>\n<li>Then <code>SSH and GPG Keys<\/code>.<\/li>\n<li>Press the <code>New SSH Key<\/code> green button and paste in the above line.<\/li>\n<\/ol>\n<p>Finally, test you connection from the CSF:<\/p>\n<pre>\r\n# On the CSF login node:\r\n# Use the github test method to check your keys\r\nssh -T git&#64;&#103;&#105;&#x74;&#x68;&#x75;&#x62;&#x2e;&#x63;om\r\n  # If you saved your key with a passphrase you'll be prompted to enter it\r\n# You should see\r\nHi <em>githubusername<\/em>! You've successfully authenticated, but GitHub does not provide shell access.\r\n\r\n# Return to the login node\r\nexit\r\n<\/pre>\n<h2>VSCode and github.com<\/h2>\n<p>Some VSCode extensions will attempt to contact github.com from the CSF login node. This occurs when you have VSCode installed on <em>your<\/em> local PC\/laptop, and you use the &#8220;SSH Extension&#8221; in VSCode to login to the CSF and edit code in your CSF home directory. But it is <em>not<\/em> possible to make VSCode run the git commands on a CSF compute node, as is normally required.<\/p>\n<p>To allow VSCode to work with github.com, some access to github from the login node will now work. We have added github.com to the &#8220;allow-list&#8221; of sites that can be contacted from the login node. Please note that the Research Infrastructure team DO NOT manage the list of permitted sites that can be contacted from the CSF login nodes. We can only make a request that access be granted to certain sites. <\/p>\n<p>If your use of VSCode is trying to contact a github service from the CSF login node and is being blocked, please contact us with the domain name (e.g., <em>something<\/em>.github.com) that is reported in any error message you receive. <\/p>\n<h2>Further info<\/h2>\n<ul>\n<li>On the login node run: <code>git help<\/code><\/li>\n<li><a href=\"http:\/\/git-scm.com\/\">http:\/\/git-scm.com\/<\/a><\/li>\n<\/ul>\n<h2>Updates<\/h2>\n<p>None<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview Git is a version control system, which allows you to keep old versions of files and directories (usually source code), keep a log of who, when, and why changes occurred, etc., From October 2025, version 2.47.3 is the system-wide default (if you load no modulefile.) Hence it is no longer necessary to load a modulefile, unless you specifically need an older version! git-lfs Git Large File Storage (LFS) replaces large files such as audio.. <a href=\"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/software\/tools\/git\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":144,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1600","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/1600","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/comments?post=1600"}],"version-history":[{"count":20,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/1600\/revisions"}],"predecessor-version":[{"id":11868,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/1600\/revisions\/11868"}],"up":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/144"}],"wp:attachment":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/media?parent=1600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}