GitLab Client Setup

These are general instructions for getting a git client installed in order to connect and use our locate GitLab service. For getting access and additional information on our local version of GitLab please see the following KB article: Gitlab Information

Windows

There are a number of Windows clients for git, this document covers Git for Windows

  1. Please review Software Regulations Policy 870 and submit a Software & Hosted Solution Purchasing Checklist form prior to installing software on any Oakland University equipment.

  2. Software
    1. Git for Windows
      1. Available from https://code.google.com/p/msysgit/downloads/list?q=full+installer+official+git

    2. TortoiseGit

      1. If you are a TortoiseSVN user then you may be more comfortable using TortoiseGit available at http://code.google.com/p/tortoisegit/

        1. Note: TortoiseGit requires !msysGit which is provided by "Git for Windows" but the TortoiseGit site recommends installing TortoiseGit first.

        2. The instructions provided here only cover setup using Git for Windows (msysgit/Git Gui)
  3. Setup up a Project (Remote Repository) on code.oakland.edu
    1. Login to https://code.oakland.edu using your NetId

    2. Click on "Projects" and then "+ New Project"
    3. Click "Create project"
    4. Enter a Project Name, e.g. - "System-Profiling" and Click "Create Project"
  4. Create an SSH Key to allow access from your machine to code.oakland.edu
    1. Start->All Programs->Git->Git Gui

    2. In Git Gui Choose Help->Show SSH Key

    3. If there is one listed then click "Copy to Clipboard"
    4. If one is not listed then click "Generate" and then Click "Copy to Clipboard"
    5. Login to https://code.oakland.edu using your NetId

    6. Click on "My Profile" (Person Icon).
    7. Click "Add Public Key"
    8. Paste Clipboard contents into the "Key" field
    9. Enter a Title for the key (e.g - [email protected] )
  5. Create a Local Repository and tell Git who you are
    1. In Git Gui
    2. Click on "Create New Repository"
    3. Browse for a Directory (using "Make New Folder" if necessary) and click "OK"
      1. It is important to note that the selected repository location Must Not exist. e.g. - "C:/Users/admnetid/Git/system-profiling"

    4. Click "Create"
    5. Click "Edit"->"Options"

    6. Fill in "User Name:" and "Email Address:" for your Repository (on the left) and for "Global" (on the right)
    7. Click "Save"
  6. Initialize the repository
    1. Browse to the location of you Local Repository, e.g. - "C:/Users/adminetid/Git/system-profiling"
    2. Create a file within the Local Repository, e.g. - README.txt
    3. Right-Click and select "Git Gui"
    4. In Git Gui Click "Stage Changed"
    5. Make a note in the "Initial Commit Message" windows (e.g. - First commit)
    6. Click "Commit"
    7. Click "Remote"->"Add"

    8. In "Remote Details",
      1. Fill out "Name:" (most likely you will want to put "origin")

        b. Fill out "Location:" ( e.g. - [email protected]/netid/system-profiling, You can find the location by logging into code.oakland.edu, Clicking on "Dashboard", then on you project, and in the "Show" tab for "SSH" you should see something starting with [email protected] ) c. Under "Further Action", Select "Do Nothing Else Now"

    9. Click "Push"
    10. Click "Push" again
    11. Click "Close"
  7. Clone your repository
    1. Use a web browser to view your repository on code.oakland.edu
      1. Ensure "SSH" button is pressed
      2. Example source link: git @ code.oakland.edu/[your NetID]/myrepo.git
    2. On the server, open Git Extensions
    3. Generate a keypair
      1. Go to remotes -> PuTTY -> Generate to import key

      2. Click "Generate"
      3. Save your public and private keys to your documents area
        • Use a convention like id_rsa for the private key and id_rsa.pub for the public key. Your private key should be kept secret.
        • Generating a key with a pass phrase is not recommended as it can give some difficulty when updating the server as a scheduled task. For ad-hoc updating please use a pass phrase.
    4. Add the public key to code.oakland.edu
      1. Go to My Profile
      2. Click "Add Public Key"
      3. Give the key a title
      4. Paste the contents of your public key on the next line
    5. Once the above steps have been completed select the clone repository
      1. Click "Load SSH key" and load the private key file
      2. Paste the repos link in the top box
      3. Try cloning to your desktop first. If successful then clone to \inetpub\wwwroot

Linux

  1. Install git
    1. Ubuntu/Debian
      1. sudo apt install git

      b. Fedora/Red Hat/CentOS
      1. sudo dnf install git

  2. Create ssh keys if you don't have one already (Check ~/.ssh for id_rsa.pub)
    1. ssh-keygen -t rsa
      1. For password-less logins for git leave the passphrase empty when prompted, otherwise make sure you remember this passphrase, you will need it when pushing to Git.
    2. Copy the contents of ~/.ssh/id_rsa.pub
    3. Login to https://code.oakland.edu using your NetId

    4. Click on "My Profile" (Person Icon).
    5. Click "Add Public Key"
    6. Paste contents if id_rsa.pub into the "Key" field
    7. Enter a Title for the key (e.g - [email protected] )
  3. Setup up a Project (Remote Repository) on code.oakland.edu
    1. Login to https://code.oakland.edu using your NetId

    2. Click on "Projects" and then "+ New Project"
    3. Click "Create project"
    4. Enter a Project Name, e.g. - "System-Profiling" and Click "Create Project"
    5. Follow instructions listed in the "Show"->"SSH" tab after creating the project.

Mac

  1. Install xcode from app store
  2. Be sure to download the "Command Line Tools" option along with xcode
  3. Create ssh keys in terminal if you don't have one already (Check ~/.ssh for id_rsa.pub)
    1. ssh-keygen -t rsa
      1. For password-less logins for git leave the passphrase empty when prompted, otherwise make sure you remember this passphrase, you will need it when pushing to Git.
    2. Copy the contents of ~/.ssh/id_rsa.pub (use pbcopy < ~/.ssh/id_rsa.pub)

    3. Login to https://code.oakland.edu using your NetId

    4. Click on "My Profile" (Person Icon).
    5. Click "Add Public Key"
    6. Paste contents if id_rsa.pub into the "Key" field
    7. Enter a Title for the key (e.g - [email protected] )
  4. Setup up a Project (Remote Repository) on code.oakland.edu
    1. Login to https://code.oakland.edu using your NetId

    2. Click on "Projects" and then "+ New Project"
    3. Click "Create project"
    4. Enter a Project Name, e.g. - "System-Profiling" and Click "Create Project"
    5. Follow instructions listed in the "Show"->"SSH" tab after creating the project.

References

  1. Git on Windows for Newbs

  2. Apress Git Pro Book

  3. GitLab Source

  4. Git

  5. Git on the command line


  • TSSHowTo