Click for DARTS Sitemap or Sitemap Text

Setting up Gitlab:

GitLab Enterprise Edition login page

  • Enter your credentials and you are in!

Create Gitlab personal access token:

  • Log in with UMS account
  • Click settings on the upper right corner 
  • Select access tokens from the User Settings
  • Create a new personal access token by giving it a name. Select "Scopes", but the expiry date is optional.
  • Click the create personal access token button

GitLab personal access token screen

  • Copy the personal access token in a notepad. Don't forget to save the token, or you won’t be able to access it again one the page is refreshed or closed.

GitLab personal access token screen showing token
Back to top

SourceTree for Gitlab:

  • Obtain Sourcetree from here: https://www.sourcetreeapp.com/
  • Download "Server" version of Sourcetree (if you haven't done so.)
  • Create a Bitbucket account when prompted with UMS credentials.
  • Open Sourcetree application and click on Add an account.

SourceTree Remote repositories add account screen for Gitlab

  • Hosting Service: choose "gitlab EE" 
  • host URL: https://gitlab.its.maine.edu/
  • Preferred Protocol: SSH
  • Click "refresh personal access token"
  • You will get a popup window that says, enter your username and password

  • Enter your username 
  • Enter personal access token (from the previous step) as your password
  • If login succeeds, you will see "Authentication OK"

SourceTree Remote repositories add account screen for Gitlab

  • Once gitlab is intergrated with Sourcetree, you will see the following screen:

Successful integration screen

  • Delete "Bitbucket" account since you will not use it.

    Back to top

Git for Windows:

  1. Go to https://gitforwindows.org/ and click download
  2. Check all boxes and click 'Next'
  3. Pick whichever you like (If you prefer UltraEdit, select other) and click 'Next'.
  4. Pick "Git form the command line and also from 3-rd party software" and click 'Next'.
  5. Pick "Use the OpenSSL library" and click 'Next'.
  6. Pick "Checkout as-is, commit as-is" and click 'Next'.
  7. Pick "Use MinTTY (the default terminal of MSYS2)" and click 'Next'.
  8. Click the first two boxes and click 'Install'. Wait for a couple of minutes.
  9. Click "Launch Git Bash" box and click "Finish"
  10. You will see new window for Git Bash.

Git Command Line Instructions:

The following commands will help upload existing files from your local machine 

Git global setup

git config --global user.name "your user.name"
git config --global user.email "youremail@maine.edu"

Create a new repository

git clone git@gitlab.its.maine.edu:YourUserName/YourNewProject.git
cd YourNewProject
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master

Push an existing folder

cd existing_folder
git init
git remote add origin git@gitlab.its.maine.edu:YourUserName/ExistingProject.git
git add .
git commit -m "Initial commit"
git push -u origin master

Push an existing Git repository

cd existing_repo
git remote rename origin old-origin
git remote add origin git@gitlab.its.maine.edu:YourUserName/ExistingProject.git
git push -u origin --all
git push -u origin --tags

Git Workflow commands

git init //initialize a folder to git
git add filename //move the file from unstaged to staged
git rm --cached filename //moves it from staged to unstaged
git reset filename //moves it from staged to unstaged
git add . //will add all files under current directory
git add --all //find all new and updated files everywhere throughout the project and add them to the staging area

Powershell/Linux commands

ls //list non-system files in directory
ls -a //lists all folders and files
cd folder //changes directory into a folder
cd .. //going one level up in folder structure
mkdir folder //makes a directory

Back to top