SCM is a way to keep track of changes to project source code over time and when worked on by multiple people. Git is one of the most popular version control systems, especially on Unices like GNU/Linux.
If you haven’t used Git before, Try Git is a pretty good place to start, and GitLab’s workflow video is useful too.
$ sudo apt-get install git
(or whatever package manager you use)
Install the Homebrew package manager, then:
$ brew install git
Download Git for Windows, which will give you the Git Bash POSIX emulator to type commands into.
The GitLab project group is here: https://gitlab.com/groups/PiONEERS.
The idea is that the person working on a specific part of the software (image processing, map making, etc) makes a project repository for that code and maintains it.
-
When you are working on a repo that you maintain, make your commits to a feature branch in that repo and send yourself a merge request when you are ready to add your changes into master. Doing this (instead of committing directly to master) groups your changes together and makes it easier for others to keep up.
-
When you are working on a repo that someone else maintains, make your commits to a feature branch in your fork of the main repo, and send a merge request to the repo maintainer when you want your changes added into master.
If someone else merges changes into the master branch while you are working on a feature branch, you will need to pull those changes into your local master and rebase your feature branch against it before merging:
On branch some-feature
$ git pull upstream master
$ git rebase master
$ git push -f origin some-feature
upstream
generally refers to the main repo, and origin
generally refers to
your personal fork, though you can call them whatever you like. The -f
flag
causes the push to overwrite commits on your branch on the server, which is
necessary because the rebase will have changed commit ordering. This is fine
because you’re the only one working on the branch, but you should never
force push to master ’cause that will mess things up for other people.
If you’re reading this wondering what the hell is going on, it will make more sense when you actually come round to doing it. There are also plenty of guides around on the internet, or you can just message/email me if you get stuck.
SSH keys provide authentication for push/pulling from the group repos. You'll need to add one to your GitLab account.
- GitHub has a pretty good guide on key management, just follow it and paste your public key into GitLab instead.
(We'll also need to create a key pair for the Pi so that it can download and run the code.)