git - from commit to merge - semcomp beta 2018 workshop

JoaoMarins1 9 views 31 slides Oct 31, 2025
Slide 1
Slide 1 of 31
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31

About This Presentation

Small workshop presentation for the semcomp beta 2018


Slide Content

Git: from commit to
merge
João Marins

João Marins
@jgcmarins @jgcmarins
2

History
3
Linus Torvalds

Writing an OS
4
-Multiple teams over the world
-Lots of features
-Lots of bug fixes
-How to not overwrite anything?

Existing Tools
5
-CVS
-BitKeeper

6
GIT
Linus Torvalds
“Source code control: the way it
was meant to be.”
https://www.youtube.com/watch?v
=4XpnKHJAok8

7
Concurrency

8
Branch System

Distributed System
9
-Work on your local copy (branch)
-Push your changes
-Request approval
-Get merged

Remotes
10
-Software source code
-Also source of truth
-Safe

Commit
11
-Do your work locally
-Create a branch from another
-Add your changes to the new branch
-Commit your changes with a message

Push
12
From locally to remote \o/

Pull Request
13
-Your branch is ready on remote
-Open pull request
-Review
-Approved \o/

Merge: get shit done
14
-Your branch to master branch
-Do not be afraid
-Make sure your code works
-Congratulations \o/

Resolving Conflicts
15
-Sometimes it happens
-Same files
-Move fast
-Merge first

Writing a Software
16

Introducing features to a
code base
17
-git clone x git remote add
-git fetch
-git pull
-git branch
-Git status

-git checkout
-git add
-git commit
-git push
-Git diff

Team work
18
Pull before Push \o/

Code Review
19
-You are responsible for your code
-Be nice with your coworkers
-Review what is to be reviewed
-Just make sure it makes sense

Best Practices
20

7 rules
21
-Separate subject from body with a blank line
-Limit the subject line to 50 characters
-Capitalize the subject line
-Do not end the subject line with a period
-Use the imperative mood in the subject line
(example: Create instead of Created or Creating)
-Wrap the body at 72 characters
-Use the body to explain what and why vs. how

7 rules
22
https://chris.beams.io/posts/git-commit/

Branch Naming
23
-[kind-of-change]/[what-is-being-changed]
Examples:
-fix/user-name-during-login
-improvement/login-screen
-feature/charge-customer-screen

Promote to production
24
-After everything get approved, merged,
tested etc
-Promote code to production

Tools
25

SSH
26
-Clone you repo with ssh instead of https
-Easy
-Safe
-Fast

Alias
27

Hands on
28
-Presence List
-Master vs Production
-Multiple Remotes
-Mono Repo

Challenge
29
-Choose a open source project you like
-Fork it
-Make your local changes
-Open a Pull Request
-Get your changes MERGED \o/

Links
30
-https://github.com/sibelius/cmds/blob/master/README.md#git
-https://stackoverflow.com/questions/492558/removing-multiple-files-from-a-git-repo-that-have-alrea
dy-been-deleted-from-disk
-https://git-scm.com/docs/git-cherry-pick
-https://chris.beams.io/posts/git-commit/

Thanks!!!
31
We are hiring