User Tools

Site Tools


developers:git:access_config

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
developers:git:access_config [2017/05/03 14:59] – ↷ Page moved from developers:access_config to developers:git:access_config Jean-Michel Beukendevelopers:git:access_config [2019/11/05 01:05] (current) – [Access configuration] Matteo Giantomassi
Line 4: Line 4:
  
 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. 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.
 +Note that with Gitlab account we mean an account on our **internal server** at gitlab.abinit.org and not an account on the gitlab.com portal!
 ===== Configuring SSH ===== ===== Configuring SSH =====
  
Line 17: Line 17:
 </code> </code>
  
-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 tree.+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.
  
 ===== Configuring Git for the first time ===== ===== Configuring Git for the first time =====
Line 43: Line 43:
 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: 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:
 <code>git remote set-url origin abinit-forge:DEVELOPER/abinit</code> <code>git remote set-url origin abinit-forge:DEVELOPER/abinit</code>
 +
 +
 +===== Additional info: Setup of the SSH environment =====
 +
 +In order to avoid typing your password every time you issue a command that accesses gitlab,
 +you have to introduce your public keys in your profile ( https://gitlab.abinit.org/profile/keys ).
 +
 +On your local machine, generate a ssh key of <color red>RSA</color> type only <color red>WITHOUT passphrase</color> :
 +
 +  ssh-keygen -t rsa
 +  
 +and call it //id_rsa_gitlab// .
 +
 +Then add a section in the  ~/.ssh/config file :
 +
 +  host gitlab
 +   Hostname gitlab.abinit.org
 +   User git
 +   KeepAlive yes
 +   IdentityFile ~/.ssh/id_rsa_gitlab
 +   
 +   
 +
 +and then, copy the public key //id_rsa_gitlab.pub// on gitlab.
 +
 +Now, you can use (on your local machine) the following syntax :\\
 +<color blue>git clone gitlab:</color><color red>user_id</color><color blue>/abinit.git</color> \\   
 +instead of the above-mentioned\\
 +<color blue>git clone git@gitlab.abinit.org:</color><color red>user_id</color><color blue>/abinit.git</color>
 +
 +To be sure the key is proposed each time git calls ssh, you can use ssh-agent:
 +
 +  ssh-agent # this starts the agent, and provides the process id
 +  # execute the 3 lines of commands that ssh-agent proposes, e.g.
 +  SSH_AUTH_SOCK=/tmp/ssh-ngsERHER3K1HS/agent.15589; export SSH_AUTH_SOCK;
 +  SSH_AGENT_PID=15590; export SSH_AGENT_PID;
 +  echo Agent pid 15590;
 +  ssh add ~/.ssh/id_rsa_gitlab # add the corresponding ssh key for gitlab
 +
  
 ===== Configuring Git for Launchpad ===== ===== Configuring Git for Launchpad =====
Line 56: Line 95:
 or: or:
 <code sh>git clone lp:~abinit-fallbacks-developers/libpsml</code> <code sh>git clone lp:~abinit-fallbacks-developers/libpsml</code>
 +
developers/git/access_config.1493816396.txt.gz · Last modified: 2017/05/03 14:59 by Jean-Michel Beuken