Explore Abinit and around
- ABINIT Coding
- Doc for new developers
As an Abinit Developer, you might want to make it easier and more comfortable for you to access the relevant repositories and tune your access parameters whenever needed, without having to restart from scratch every time you change something. There are two software components you need to tweak in order to achieve this: SSH and Git.
Here, we will suppose that you have already configured your Gitlab account properly and added the relevant SSH public keys to your profile, and that you have opened a terminal.
To be able to push your contributions to the Abinit Forge efficiently, you need to add the following section to your ~/.ssh/config. Just create the file if it does not exist.
Host abinit-forge HostName gitlab.abinit.org User git ServerAliveInterval 52 Compression yes
You will then be able to use the abinit-forge keyword with Git to clone, pull, and push, to your repository. Later, whenever you need to tune any SSH-related parameter, you will just have to edit ~/.ssh/config and all your changes will be automatically and instantly available to Git, in all your working trees.
If this is the very first time you run Git and plan to contribute to Abinit, we urge you to set the following parameters before doing anything else, by typing the following:
mkdir -p $HOME/.config/git git config --global user.name "Firstname Lastname" git config --global user.email "email@example.com" git config --global core.editor "my_preferred_editor" git config --global core.excludesFile "$HOME/.config/git/ignore" git config --global color.ui "auto" git config --global merge.conflictstyle "diff3"
where you replace Firstname, Lastname, firstname.lastname@example.org, and my_preferred_editor, by your respective first name, last name, email address, and preferred editor.
Once you have configured SSH to access the Abinit Forge, if this is the only remote address you use, the only thing you have to do with Git is using the abinit-forge keyword when dealing with the Forge.
To clone your repository, just type the following:
git clone abinit-forge:DEVELOPER/abinit
where you replace DEVELOPER by your Abinit Forge login.
If you had already cloned your repository before setting SSH and want to benefit from this new configuration, just go to the top directory of your Abinit working tree and type:
git remote set-url origin abinit-forge:DEVELOPER/abinit
If you are using and/or developing Abinit-related packages located on Launchpad, we recommend you to add the following to your Git configuration:
git config --global "url.git+ssh://USER@git.launchpad.net/.insteadOf" "lp:"
where you replace USER by your Launchpad user name.
Once done, you can interact with Launchpad through the “lp:” prefix, e.g.:
git clone lp:abinit-fallbacks
git clone lp:~abinit-fallbacks-developers/libpsml