developers:git:access_config
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
developers:git:access_config [2017/05/16 12:58] – [Configuring SSH] Yann Pouillon | developers:git:access_config [2024/09/02 14:20] (current) – Maryam Azizi | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <WRAP important> | ||
+ | |||
====== Access configuration ====== | ====== Access configuration ====== | ||
Line 4: | Line 6: | ||
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 43: | Line 45: | ||
If you had already cloned your repository before setting SSH and want to benefit from this new configuration, | If you had already cloned your repository before setting SSH and want to benefit from this new configuration, | ||
< | < | ||
+ | |||
+ | |||
+ | ===== 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:// | ||
+ | |||
+ | On your local machine, generate a ssh key of <color red> | ||
+ | |||
+ | ssh-keygen -t rsa | ||
+ | | ||
+ | and call it // | ||
+ | |||
+ | Then add a section in the ~/ | ||
+ | |||
+ | host gitlab | ||
+ | | ||
+ | User git | ||
+ | | ||
+ | | ||
+ | |||
+ | |||
+ | |||
+ | and then, copy the public key // | ||
+ | |||
+ | Now, you can use (on your local machine) the following syntax :\\ | ||
+ | <color blue>git clone gitlab:</ | ||
+ | instead of the above-mentioned\\ | ||
+ | <color blue>git clone git@gitlab.abinit.org:</ | ||
+ | |||
+ | 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=/ | ||
+ | SSH_AGENT_PID=15590; | ||
+ | echo Agent pid 15590; | ||
+ | ssh add ~/ | ||
+ | |||
===== Configuring Git for Launchpad ===== | ===== Configuring Git for Launchpad ===== | ||
Line 56: | Line 97: | ||
or: | or: | ||
<code sh>git clone lp: | <code sh>git clone lp: | ||
+ |
developers/git/access_config.1494939514.txt.gz · Last modified: 2017/05/16 12:58 by Yann Pouillon