Git
Git is an highly popular distributed version control system that is used to keep all historical changes for a project, with the ability to revert to a former change, and allows for easy and seamless collaboration among multiple developers through merging of code.
When searching for scientific software, tutorials, and datasets online, you'll see Git as the primary tool used for services such as GitHub, GitLab, and BitBucket.
Never Used Git?
Are you new to Git and would like to know how to use it for your research or class coding project? Contact the HPC Team and we'd be glad to introduce you to a new way to collaborate with other members in the group.
Availability
| Cluster | Module/Version | Git LFS Support |
|---|---|---|
| BOSE | 2.27.0* git/2.51.0 git/2.54.0 |
3.7.1 |
| BGSC | 2.43.5* git/2.28.0 |
*Installed By Default
Git is installed by default on both of our clusters and does not require loading a module. However, we recommend using the modules when the version is higher as that is easier to keep up to date and can be more secure.
Sample Slurm Script
#!/bin/bash
# -- SLURM SETTINGS -- #
# [..] other settings here [..]
# The following settings are for the overall request to Slurm
#SBATCH --ntasks-per-node=32 # How many CPU cores do you want to request
#SBATCH --nodes=1 # How many nodes do you want to request
# -- SCRIPT COMMANDS -- #
# Load the needed modules
module load git # Load Git - If overriding default version
git clone https://github.com/username/my-repo.git
Git LFS
Usage of git-lfs
With git version 2.54.0 we've added support for Git LFS, allowing for large file management using pointers inside of git.
A sample for accessing the module is as follows:
Installation into a repository
In order to actually use the functionality of git lfs, you must first install it into the directory. You can do so by doing the following:
By using the --local flag it's only modifying the .git/config file of the current directory, rather than your global/user config file.
Additionally, to begin tracking the files within a directory you can use the git lfs track command. An example of it's application is below.
All files in a target directory:
All files that have a file extension of .psd:
Real Example
Has your research group used Git in a project? Contact the HPC Team and we'd be glad to feature your work.