How to push and pull

This document should help you get started with the wiki on our gitlab via the managed server. Gitlab is a version control solution, which allows you to track all changes made on your project and to publish it on a homepage.

Create a local repository

  1. Open pycharm VCS → Checkout from Version Control → Git and fill in the information below. You can download Pycharm here

URL: https://gitlab.com/energyhub/public/documentation.wiki.git Directory: G:\EnergyHub\Projects\Wiki\your name\documentation.wiki 2. Authentication Failed Go to Windows Credential Manager (press Windows Key and type ‘credential’) to edit the git entry under Windows Credentials. >Replace old password with the new one 3. Click “Clone” 4. Your repository is cloned to your computer

Create a new branch

You can imagine branches as different versions of the same repository. There is always a branch called master and different other branches. The master branch is the only branch visible on the website and it is “read only” for developers. The branches are visible in pycharm at “Version Control” on the bottom left and “Log”. All branches of the repository are always available remote and local. To create a new branch on the remote repository you have to follow the steps below.

  1. After you cloned your project you go to “Git:master” on the bottom right and click on “+ New Branch”

  2. The name of you new branch can be your name. This is the only branch you are gone work on.

  3. You created your branch. Now it is time to push these changes to the remote branches hosted on the server because now the created Branch “Ralf is only on your local repository.

Commit

Committing means describing a change you do on the code.

  1. You can do this by changing something and clicking on the “check” on the upper right corner.
  2. Add a “Commit message”.

Push

Pushing means copying the changes from your local branches to the remote branches hosted on the server. You should do this quite often. It’s done by:

  1. VCS → Git → Push
  2. You can see from which local branch. In this case, Ralf to which remote branch you are pushing. origin/Ralf.

  3. You click on push. Congrats, you pushed your change.

Pull

Every now and then, I will merge your branch into the master branch and your changes will be visible online. I will also delete your branch and you have to pull the master branch, which is remote to your computer and create a new branch again.

  1. Check out the master branch in your local branches
  2. Click checkout “Checkout”
  3. Pull the newest version by clicking on the blue arrow in the upper right corner
  4. Click “OK”

  5. Now you can create a new branch