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
- 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.
After you cloned your project you go to “Git:master” on the bottom right and click on “+ New Branch”
The name of you new branch can be your name. This is the only branch you are gone work on.
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.
Committing means describing a change you do on the code.
- You can do this by changing something and clicking on the “check” on the upper right corner.
Add a “Commit message”.
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:
- VCS → Git → Push
You can see from which local branch. In this case, Ralf to which remote branch you are pushing. origin/Ralf.
You click on push. Congrats, you pushed your change.
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.
- Check out the master branch in your local branches
- Click checkout “Checkout”
- Pull the newest version by clicking on the blue arrow in the upper right corner
Now you can create a new branch