Gitlab

Version Control with Gitlab – Creating your first repository

First off, you need to have an account at https://gitlab.com. The reason I prefer Gitlab compared to say Github, is due to the free nature of cloud projects. For Github if you wish to keep a particular repository private, you must have a paid-account to do so. Whereas with Gitlab you can have private repositories for free, as well as deploy your own internal Gitlab server. For now, we’ll just be using the on-Gitlab account type.

Once your account is made, go to:

Projects > Your Projects
Create New

Sample project page

Your main considerations on this first step, are:

  • Project Name – Make it somewhat meaningful for your purpose
  • Visibility – Do you want people to see this repository or not?
  • Initialize with a README – If you do not have a folder on your computer you’re planning to upload, check this box.

Click on ‘Create’ and your project is now live for editing.


Install git for your operating system

Download git for OSX

Download git for Windows

Download git for Linux


Downloading your Project

We will use the HTTPS git method to get you up and running quickly. I would recommend switching to SSH authentication at a certain point, but for now you should be OK using HTTPS.

Locate the HTTPS download link for your new repository.

Gitlab project page – HTTPS field may show “SSH” at first. Click the drop-down to change.

Open a command line, or Powershell console, and navigate to a folder that you want your project saved to. For me, I navigated to a folder at

C:\scripts

Once my prompt was at that folder, run this command to download your new repository:

git clone https://gitlab.com/Dpink/hyper-v-dashboard.git

Once it finishes running, you can freely visit that repository via File Explorer as well.

Once you add new files to this location, you can easily upload your changes by doing the following:

# This adds changed files to the git record
git add .

# This commits the new files with a comment. Make it useful
git commit -m "My first commit - New Files!"

# This pushes the committed files up to your repository
git push origin master

If you do not have credentials saved in your git client, you will be prompted to login as above.

Git push completed

You can double-check that it’s now successfully on the repository by going to your project page and refreshing. You’re all done!