Download the repo
git clone https://git.ufz.de/mhm/mhm.git
Configure the default remote repo
Your default remote repository should be GitLab. I.e., your
.git/config should contain something like this:
[remote "origin"] url = https://git.ufz.de/mhm/mhm.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master
origin is the name of your remote (i.e., Gitlab).
Show current status:
Show commit history:
Get the latest update
First, make sure that you have a clean repository before pulling, i.e., no uncommitted changes. Then:
This is like
NOTE: GitLab is not yet ready for code development. Please use the SVN repo. It is planned to migrate from SVN to Git in the course of 2018.
Add untracked files:
git add .
Also track empty folders (git ignores empty folders):
git commit -am "branch: some changes made"
In contrast to SVN, you can commit on you local copy of the repo without touching the remote repo. In contrast to SVN, using Git gets easier if you commit more often (i.e., even small changes).
Ususally, the content of both conflicting files are merged into the current file and seperated by
>>>>>> lines. Edit the file and tidy up those differences, then commit again.
Push commits to GitLab
SVN pushes everytime it commits. In Git, these are two separate things, such that you can develop and commit your code locally, and push them to the remote later.
Add a (release-)tag to the last commit:
git tag -a v5.9 -m "mHM release version 5.9"
Push tag label to remote (they are not transfered with a normal push):
git push origin v5.9
If not existing, add a link to the remote GitHub.com repo:
git remote add github https://github.com/mhm-ufz/mhm.git
Push the latest release (of the master branch) to GitHub.com:
git push github master git push github v5.9
The changes should now be on GitHub.com.