...
Share code among a subset of your team, your entire team, or any number of other teams
on the SDC and provide comments to improve each other’s codeSimplified collaboration with shared read/write access
Support for multiple repositories to be kept in a logical structure that separates them from
each other and groups by organization.Version control and source code management including:
File locking to help prevent conflicts
Users can work from their local copy of the code
Users can branch code to make changes and then quickly merge it after approval
Log In to GitLab
Open Within your SDC workstation, open a web browser, then navigate to https://gitlab.prod.sdc.dot.gov, which . This is the URL of to the SDC SDC’s internal GitLab implementation.
In the Sign in page, the LDAP login option is selected by default. Enter your SDC credentials as the LDAP username and password, then click Sign in (in the LDAP Username field, do not enter the “@securedatacommons.com” portion of your SDC username).
The Welcome to GitLab web page is displayed.
...
Select the GitLab icon on the upper left to return to the home page.
A list of your projects appears. Select the name of the project you want to add members
/groups to.Click on Settings and then Members from the left navigation menu.
You can add individual users or entire groups to the project.a.
Select the Invite member tab to add members individually to the project.
Start entering the project member’s name or email address into GitLab
member or Email address to select from the autocomplete list.
Select a role for the project member from the drop-down menu under
Choose a role permission.
Click Add to project.
...
Select the Invite group tab to add an entire group to the project.
...
Start entering the group’s name into Select a group to invite to select from
the autocomplete list.
...
Select a role to apply for the group from the drop-down menu under Max
access level.
...
Select Invite to grant the group access to the project repository.
...
Generate SSH Key
To set up git integration, you need to have an SSH key on your SDC workstation. This key
authenticates your identification to GitLab so that you can push commits to the project
repository.
NOTE: For Windows users, perform the following commands in Git Bash. If Git Bash is not
installed on your Windows workstation, please copy the Git Bash installer, Git-2.19.1-64-
bit.exe, from the Z:\software-distribution folder and then install it.
To store your authentication credentials for git, use a hidden folder called “.ssh.” First,
check to see if the folder exists with ls –a.Code Block ls –a
If not, create it using the command
mkdir .ssh:Code Block mkdir .ssh
...
Confirm this works by entering ls –a to see all objects in the current directory
...
. You should see the .ssh listed:
Code Block ls –a
...
Generate a new key to store in this location by typing the following command and then hitting the Enter key:
...
It will output the following message: “Generating public/private rsa key pair.”
...
It will ask you where to save the file and to enter a passphrase with the following three
prompts. Hit the Enter key each time (no need to enter anything else) to accept the
defaults.
• “Enter file in which to save the key:”
• “Enter passphrase (empty for no passphrase):”
• “Enter same passphrase again:”
...
After the following confirmation messages, the new SSH key is now stored in the .ssh
folder.
• “Your identification has been saved in /c/Users/SDCusername/.ssh/id_rsa.”
• “Your public key has been saved in /c/Users/SDCusername/.ssh/id_rsa.pub.”
...
The default key file name is id_rsa and is saved under the .ssh folder (e.g.,
C:/Users/[SDCusername]/.ssh/ in Windows; $HOME/.ssh/id_rsa in Linux)
...
You now need to provide the public part of this key to GitLab by copying the “.pub” part
of the key. Here are the different options for copying the public SSH key.
...
Option 1:
On Windows, open the id_rsa.pub file (under the C:/Users/[SDCusername]/.ssh folder) in
a text editor (Notepad) and copy the entire key by using Select All then Copy. Be careful
not to accidentally change anything!
Option 2:
Copy your public SSH key to the clipboard by using one of the commands below
depending on your Operating System:
...
Git Bash on Windows:
Code Block cat ~/.ssh/id_rsa.pub | clip
WSL/GNU/Linux (requires the xclip package):Code Block xclip -sel clip < ~/.ssh/id_rsa.pub
If using Jupyter, use the head command. Right-click on the output and click copy:
Code Block head ~/.ssh/id_rsa.pub
8. From the GitLab home page, add your public SSH key to your GitLab account:
a. In the upper-right corner, click on your avatar image and then click Settings.
b. From the left navigation menu, click SSH Keys.
c. In the Key field, paste your public SSH key.
d. The Title field will be automatically populated with SDCusername@securedatacommons.com.
e. Click the Add key button.
8. To test whether your SSH key was added correctly, run the following command in your
terminal:
ssh -T git@scm. internal.sdc.dot.gov
...