Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

...

The following sections provide instructions for SDC users on setting up GitLab repositories for
committing and sharing their code and any other documents.
GitLab provides an organizational structure of users and repositories managed respectively via
“groups” and “projects” to promote collaboration among teams of SDC users. Groups contain
members with different access levels to their project repositories based on the assigned roles:

Role

Read-Only

Read/Write

Guest

(tick)

Reporter

(tick)

Developer

(tick)

Maintainer

(tick)

GitLab Features:

  • Share code with specific team members, your entire team, or different research teams that are also using the SDC.

  • Simplified collaboration with shared read/write access.

  • Manage multiple repositories that are organized and structured in a logical manner.

  • 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

...

  1. Your key authentication credentials are, by default, stored in a hidden folder named “.ssh.”
    You’ll need to ensure this folder exists in your home directory before creating your key.
    This can be done using Git Bash (for Windows), as shown below.

    1. Open the Git Bash application from the Git Extensions application as shown in the picture below.

      1. Under Git Extensions Tools Tab, click on ‘Git Bash’ and hit enter


        b. The Git Bash terminal opens and should be active within your home directory.
        The title bar of the terminal window will display MINGW64/c/Users/<your-SDC-username>,
        where <your-SDC-username> is your actual SDC user credential.


        c. Use Git Bash to check if the .ssh folder already exists in your home directory:
        At the $ prompt, type the following command and then hit enter.

        Code Block
        ls -a

        This will list all objects in your home directory.



        d. Confirm whether you see the .ssh folder listed in the results:


        e. If not found, then create the .ssh folder:
        At the prompt, type the following and then hit enter.

        Code Block
        mkdir .ssh

        f. Confirm the .ssh folder is now created:
        At the prompt, type the following and then hit enter.

        Code Block
        ls -a


  2. Next, use Git Bash to generate a new SSH key and store it in the .ssh folder.

    a. Generate the key pair:
    At the prompt, type the following command* and then hit enter

    Code Block
    ssh-keygen -t rsa -b 4096 -C "<your-SDC-username@dot.gov>"


    *NOTE: Be sure to replace <your-SDC-username@dot.gov> with your SDC email address,
    or other email address/ identifier of your choosing.

    b. It will output the following message: “Generating public/private rsa key pair.

    c. It will then ask you where to save the file with the prompt “Enter file in which to save the key:
    At the prompt, type the following and hit enter.

    Code Block
    C:\Users\<your-SDC-username>\.ssh\id_rsa


    d. It will also ask you to enter a passphrase with the following 2 prompts.
    • “Enter passphrase (empty for no passphrase):”
    • “Enter same passphrase again:”
    Hit the Enter key each time (no need to enter anything else) to accept the defaults.

    e. The following messages confirm 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.”

    NOTE:  Your SSH key pair is comprised of two files, which have been saved under the .ssh folder in your home directory ( C:/Users/<your-SDC-username>/.ssh/ ) .  
    The private identification is saved in the id_rsa file and the public part of the key is saved in the id_rsa.pub file.

...