Commit 375e479a authored by Chris Bills's avatar Chris Bills

Use xgitlab for examples

parent d80eb870
#### **NOTE** - Replace gitlab.cels.anl.gov with xgitlab.cels.anl.gov in the examples if you are working with xgitlab.cels.anl.gov. #### **NOTE** - Replace xgitlab.cels.anl.gov with gitlab.cels.anl.gov in the examples if you are working with gitlab.cels.anl.gov.
### bash-functions ### bash-functions
...@@ -37,31 +37,31 @@ A collection of useful git aliases. These can be placed in `~/.gitconfig` (recom ...@@ -37,31 +37,31 @@ A collection of useful git aliases. These can be placed in `~/.gitconfig` (recom
### 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/gitlab.cels.anl.gov` * `ssh-keygen -t rsa -b 2048 -f ~/.ssh/xgitlab.cels.anl.gov`
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://gitlab.cels.anl.gov/profile/keys 1. Browse to: https://xgitlab.cels.anl.gov/profile/keys
1. Click Add SSH Key (top-right) 1. Click Add SSH Key (top-right)
1. Set the title to something meaningful 1. Set the title to something meaningful
1. Copy your public key and paste it into the Key field 1. Copy your public key and paste it into the Key field
1. Click Add Key 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 gitlab:namespace/project.git` without needing to pass a username, fqdn, or ssh identity to git * 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
``` ```
Host gitlab Host xgitlab
User git User git
Hostname gitlab.cels.anl.gov Hostname xgitlab.cels.anl.gov
IdentityFile ~/.ssh/gitlab.cels.anl.gov IdentityFile ~/.ssh/xgitlab.cels.anl.gov
``` ```
### Cloning a Repository ### Cloning a Repository
Once you've set up SSH, cloning a repository hosted on GitLab is pretty simple and straightforward. The structure of a repository's URI is: <host>:<namespace>/<project>.git (example: gitlab:systems/git-tips.git). Determine where you want to clone the repository; a directory like ~/projects/ works pretty well, but it really doesn't matter; wherever you are most comfortable working. Once you've set up SSH, cloning a repository hosted on GitLab is pretty simple and straightforward. The structure of a repository's URI is: <host>:<namespace>/<project>.git (example: xgitlab:systems/git-tips.git). Determine where you want to clone the repository; a directory like ~/projects/ works pretty well, but it really doesn't matter; wherever you are most comfortable working.
* Change to your projects directory (e.g. `cd ~/projects`) * Change to your projects directory (e.g. `cd ~/projects`)
* `git clone -o systems gitlab:systems/git-tips.git` * `git clone -o systems xgitlab:systems/git-tips.git`
That's it. That's it.
...@@ -99,15 +99,15 @@ The fork-style workflow is useful when there are numerous contributors managing ...@@ -99,15 +99,15 @@ The fork-style workflow is useful when there are numerous contributors managing
Forking a repository on GitLab: Forking a repository on GitLab:
* Browse to https://gitlab.cels.anl.gov/systems/git-tips.git * Browse to https://xgitlab.cels.anl.gov/systems/git-tips.git
* Click the button in the top right that says 'Fork' * Click the button in the top right that says 'Fork'
* Select the namespace you want to create the fork in * Select the namespace you want to create the fork in
Getting set up with your fork and multiple remotes: Getting set up with your fork and multiple remotes:
``` ```
git clone -o foo gitlab:foo/git-tips.git # Clone your fork git clone -o foo xgitlab:foo/git-tips.git # Clone your fork
git remote add systems gitlab:systems/git-tips.git # Add the 'systems' remote git remote add systems xgitlab:systems/git-tips.git # Add the 'systems' remote
``` ```
You now have two remotes; 'foo' and 'systems'. You can push or pull code using either of them: You now have two remotes; 'foo' and 'systems'. You can push or pull code using either of them:
...@@ -129,7 +129,7 @@ Whether using the fork or branch workflows, contributing changes to a project (a ...@@ -129,7 +129,7 @@ Whether using the fork or branch workflows, contributing changes to a project (a
When all is said and done, and you have work that is ready to be reviewed by others and potentially pushed to 'production', you will need to create a Merge Request on GitLab: When all is said and done, and you have work that is ready to be reviewed by others and potentially pushed to 'production', you will need to create a Merge Request on GitLab:
* Browse to the project's page on GitLab (e.g. https://gitlab.cels.anl.gov/systems/git-tips.git) OR your forked repository's page * Browse to the project's page on GitLab (e.g. https://xgitlab.cels.anl.gov/systems/git-tips.git) OR your forked repository's page
* Locate and click '+ New Merge Request' near the top right of the page (Subject to change as GitLab evolves) * Locate and click '+ New Merge Request' near the top right of the page (Subject to change as GitLab evolves)
* Select your source project and branch (e.g. systems/git-tips and 'foo', or username/git-tips and 'foo') * Select your source project and branch (e.g. systems/git-tips and 'foo', or username/git-tips and 'foo')
* Select your target project and branch (e.g. systems/project and 'prod') * Select your target project and branch (e.g. systems/project and 'prod')
...@@ -167,7 +167,7 @@ for branch in $(git branch -r | grep source | grep -v HEAD); do ...@@ -167,7 +167,7 @@ for branch in $(git branch -r | grep source | grep -v HEAD); do
done done
# Where 'namespace' is the user/group, and 'project' is the name of the project on GitLab: # Where 'namespace' is the user/group, and 'project' is the name of the project on GitLab:
git remote add gitlab gitlab:<namespace>/<project>.git git remote add xgitlab xgitlab:<namespace>/<project>.git
git push gitlab --all # Push all local branches to the new remote git push xgitlab --all # Push all local branches to the new remote
git push gitlab --tags # Push any local tags to GitLab (optional) git push xgitlab --tags # Push any local tags to GitLab (optional)
``` ```
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