Creating a Repository

Create a Remote Repository

  1. Navigate to https://gitlab.com/projects/new
  2. click Create Blank Project button

Creating a Local Repository and Pushing to Remote Repository

  1. Navigate to the root folder of the project you would like to become a repository.
  2. git init
    • this generates a .git folder in this directory.
    • the .git tells this directory that it is a git-repository, enabling subsequent git commands in this directory.
  3. git add .
    • adds all changes in this directory to the repository
    • this modifies the contents of the aforementioned .git folder
  4. git commit -m 'my update message'
    • commits these changes to be pushed onto the web
    • this modifies the contents of the aforementioned .git folder
  5. git push -u origin master
    • pushes the committed changes onto the web, making them accessible through the web.
    • the local .git is compared to the remote .git, and respective changes are written as a new commit

Cloning a Preexisting Project

Adding Changes to Preexisting Git Repository

  1. navigate to the root directory of the project on your local machine
  2. add changes
    • git add .
  3. commit change
    • git commit -m 'update message'
  4. push changes to web
    • git push -u origin master
  5. Refresh the webpage to ensure your changes are visible.

Pulling Changes from Remote Repository to Local Repository