Commit 4fb77a90 authored by Chris Bills's avatar Chris Bills

Update README.md

parent ba5431a8
...@@ -14,23 +14,46 @@ More information about branching, forking, rebasing, merging and all that good s ...@@ -14,23 +14,46 @@ More information about branching, forking, rebasing, merging and all that good s
### Getting Started with GitLab ### Getting Started with GitLab
1. Generate an SSH keypair for GitLab (optional) 1. Generate an SSH keypair for GitLab (optional)
* `ssh-keygen -t rsa -b 2048 -f ~/.ssh/xgitlab.cels.anl.gov`
You can use an existing keypair (e.g. `id_rsa` / `id_rsa.pub`) if you prefer, but it is generally a good idea to have unique keys for distinct services. If you already have a keypair you would like to use, skip this step.
```
ssh-keygen -t rsa -b 2048 -f ~/.ssh/xgitlab.cels.anl.gov
```
**Note:** This command will generate 2 files; `~/.ssh/xgitlab.cels.anl.gov.pub` (your public key) and `~/.ssh/xgitlab.cels.anl.gov` (your private key).
1. Add your SSH public key to your account on GitLab: 1. Add your SSH public key to your account on GitLab:
1. Browse to: https://xgitlab.cels.anl.gov/profile/keys
1. Copy your public key and paste it into the Key field In order to authenticate your user with GitLab, you will need to provide the public portion of the keypair you wish to use to the GitLab service.
1. Set the title to something meaningful
1. Click Add Key 1. Browse to: https://xgitlab.cels.anl.gov/profile/keys
1. Copy your **public** key (the filename ends with `.pub`) to your clipboard
1. Paste your public key into the "Key" field
1. Set the "Title" to something meaningful
1. Click "Add Key"
1. Add an entry for GitLab in your ~/.ssh/config file (Optional but very convenient) 1. Add an entry for GitLab in your ~/.ssh/config file (Optional but very convenient)
* This will allow you to type something like `git clone xgitlab:namespace/project.git` without needing to pass a username, fqdn, or ssh identity to git
``` `~/.ssh/config` is your user's configuration file that is used by the ssh client. You can set the specific SSH options to use for new connections by adding an entry to the file, like below:
Host xgitlab
User git ```
Hostname xgitlab.cels.anl.gov Host xgitlab
IdentityFile ~/.ssh/xgitlab.cels.anl.gov User git
``` Hostname xgitlab.cels.anl.gov
IdentityFile ~/.ssh/xgitlab.cels.anl.gov
```
Without the above entry in your SSH config, to clone a project, you might have to type:
```
GIT_SSH_COMMAND='ssh -i ~/.ssh/xgitlab.cels.anl.gov' git clone git@xgitlab.cels.anl.gov:cpbills/git-tips.git
```
But with the above entry in your SSH config, you can clone the project by typing:
```
git clone xgitlab:cpbills/git-tips.git
```
### Setting the git author ### Setting the git author
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment