

François Sevaistre
VP of Engineering
@ Pretto

What is Git?
"I'm an egotistical bastard, and I name all my projects after myself. First 'Linux', now 'Git'"
- Linux Torvalds
Backup
&
Version control
- A blob is the content of a file. Blobs have no proper file name, time stamps, or other metadata.
- A tree object is the equivalent of a directory. It contains a list of file names, each with a reference to a blob or tree object that is that file, symbolic link, or directory's contents.
- A commit object links tree objects together into a history. It contains the name of a tree object, a time stamp, a log message, and the names of parent commit objects.
- A tag object is a container that contains a reference to another object.
4 object types
Gitflow
Github flow


Gitlab flow
Git messages

Guidelines
- Prefix the subject line ([Feat], [Fix], [Chore]...)
- 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

Commit early
Commit often
Squash
Squash & Merge
Merge / rebase difference
- A - B - C - D - remote HEAD
\
E - F - G - local HEAD
- A - B - C - D - remote HEAD
\ \
E - F - G - local HEAD - new local HEAD
- A - B - C - D - remote HEAD - E' - F' - G' - local HEAD'
After merge
After rebase
Cheatsheet
Base commands
- git checkout master
- git pull
- git checkout -b new-branch
- git stash
- git stash pop
- git add -p
- git commit
- git push --set-upstream origin new-branch
Workspaces
Useful commands
- Woops, I committed too quickly:
- Reset last commit: git reset HEAD^
- Edit last commit: git commit --amend
- Woops, what have I done?
- git reflog
More commands
Interactive rebase
- git rebase -i HEAD~5
- git rebase -i another-branch

Git bisect

Thanks!
Git
By François Sevaistre
Git
A quick git presentation
- 119