Installation and Setup
Git configuration
First: Download Git. After installing Git, please run these commands one after another in your terminal (it doesn’t matter in which directory you currently are) to check and complete your setup (you can just copy-paste the commands):
git --version
git config --global user.name "Example Name"
git config --global user.email example@example.com
git config --global init.defaultBranch main
git config --global core.editor ExampleEditor
git config --global core.editor nano
.
git config --global pull.rebase false
git config --global pull.merge true
cat ~/.gitconfig
[user] name = Your Name email = yourname@yourplace.org
[core] editor = YourEditor
[init] defaultBranch = main
[pull] rebase = false merge = true
GitLab account
- For this course you must have an account on gitlab.com. This is a different GitLab from our University GitLab which we provide through the DataHub. As our instructors Peer and Michael are not part of University Marburg, they don't have access to our University GitLab. Hence, we set up this course on gitlab.com to ensure access to EVERYONE.
- Please set up an ssh connection to communicate with GitLab. You can follow these instructions to do so.
- The very important part is to check if you can connect by typing
ssh -T git@gitlab.com
in your terminal. It should give you this
The authenticity of host 'gitlab.com (35.231.145.151)' can't be established.
ECDSA key fingerprint is SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw.
Are you sure you want to continue connecting (yes/no)? yes
YES!
Warning: Permanently added 'gitlab.com' (ECDSA) to the list of known hosts.
VSCode
I always recommend to work in VSCode for various reasons. With Git it is even more convenient, as it has a built-in terminal and a built-in Git integration. What is more, you can install multiple extension packs for Git as well as for GitLab.
When you open VSCode you see a "brick" symbol on the left side bar. This is for installing extensions. I recommend installing the Git Graph extension and the GitLab Workflow extension.
You can of course use any editor you want, though. This is just a recommendation.