+ - 0:00:00
Notes for current slide
Notes for next slide

Collaboration & Version Control using Git

Eric Stemmler

04. April 2022

1 / 20

2 / 20

... the problem

  • many people changing the same file(s)
  • development is trial-and-error: How to go back?
3 / 20

... the problem

  • many people changing the same file(s)
  • development is trial-and-error: How to go back?

... the solution

  • tracking changes (who/ when/ what/ why)
  • backup (revert changes)
3 / 20

Setting up Git (on Windows)

[Start] → Git GUI

4 / 20

Generate an SSH key pair

Help → Show SSH Key

5 / 20

Generate an SSH key pair

Generate key → Enter a password → Click "Copy To Clipboard"

6 / 20

Import key into GitLab profile

Go to https://git.tirana.al → log in → click "Edit Profile"

7 / 20

Import key into GitLab profile

SSH Keys → paste ssh key → click "Add key"

8 / 20

Import key into GitLab profile

9 / 20

Clone a repository

10 / 20

11 / 20

Git Bash

12 / 20

Pull latest changes

Type into the bash console

git pull
13 / 20

Memorize these shell commands ...

... to track of changes

# do your changes to file "bcmt.xlsm"
git add bcmt.xlsm
git commit -m "implemented feature A, solving issue #3"
git push
14 / 20

Memorize these shell commands ...

... to track of changes

# do your changes to file "bcmt.xlsm"
git add bcmt.xlsm
git commit -m "implemented feature A, solving issue #3"
git push
14 / 20

Memorize these shell commands ...

... to revert changes

Find commit

git log
## bash: line 1: cd: ../bcmt-excel/: No such file or directory
## commit 9a88b976eba3ca44558a0decfc3c11d618383b40
## Author: Eric Stemmler <eric.stemmler@cimonline.de>
## Date: Mon Apr 4 16:16:00 2022 +0200
##
## minor
##
## commit d7a08cd316818eafa82a7637678e8928f19d2a91
## Author: Eric Stemmler <eric.stemmler@cimonline.de>
## Date: Mon Apr 4 16:14:16 2022 +0200
##
## cleaned
15 / 20

Memorize these shell commands ...

... to revert changes

## bash: line 1: cd: ../bcmt-excel/: No such file or directory
## commit d7a08cd316818eafa82a7637678e8928f19d2a91
## Author: Eric Stemmler <eric.stemmler@cimonline.de>
## Date: Mon Apr 4 16:14:16 2022 +0200
##
## cleaned

(Excel sheets are binary files)

# short commit-hash: d07800e
git revert --no-commit d07800e
git checkout --ours bcmt.xlsm
git revert --continue
16 / 20

first day

git config --global user.name "Eric Stemmler"
git config --global user.email "eric.stemmler@cimonline.de"
git clone "https://git.tirana.al/suti/bcmt"

Tells git who you are.

Downloads the current state and the entire history

Creates new folder bcmt in the current directory

17 / 20

in the morning

git pull

Downloads all changes that have been pushed by others.

18 / 20

in the afternoon

git push

Share your changes

19 / 20

20 / 20

2 / 20
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow