Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Workshop Git
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Martijn Brekhof
March 08, 2016
Programming
49
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Workshop Git
Workshop Git for Thalia at Radboud University Nijmegen
Martijn Brekhof
March 08, 2016
Other Decks in Programming
See All in Programming
Web Framework Benchmark Battle 2026, Any%
a_matsuda
2
2k
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
sbt 2.0: takeoff
eed3si9n
0
160
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
220
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
150
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
2
880
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
Optunaを作ったときにやりたかったこと、その後 (2026/10/16, Optuna Meetup #3)
iwiwi
1
430
AI主導のプログラミング学習アプリを作ってみた
econanringo
0
180
複雑なUIコンポーネントとの ⻑い付き合い⽅:波及するバグからテスト戦略を経て、安全な再設計へ
mixplace
0
410
SREの越境 / SRE Collaboration
y0hgi
2
310
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3.1k
Side Projects
sachag
456
43k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
59k
Prompt Engineering for Job Search
mfonobong
0
520
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
750
Music & Morning Musume
bryan
48
7.4k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
220
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
310
Building a Scalable Design System with Sketch
lauravandoore
464
34k
Writing Fast Ruby
sferik
630
63k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Transcript
v2a – h01 – 1 Workshop Git • 2hour workshop
based on AT Computing's course: • Requirements: ◗ Computer with Git installed ◗ Basic knowledge of Linux/UNIX operating systems and commandline usage • License: AttributionNonCommercialNoDerivatives 4.0 International Version control with Git http://www.atcomputing.net/Training/versioncontrolwithgit.en.php © 2016 AT Computing http://creativecommons.org/licenses/byncnd/4.0/ (CC BYNCND 4.0)
v2a – h01 – 2 Different implementations (1) Client file1
Version Database file2 ... version 2 version 1 version 1 ... Server Client file1 file2 ... Client file1 file2 ... Client/Server Centralized Local Version Database version 2 version 1 version 1 ... © 2016 AT Computing (CC BYNCND 4.0)
v2a – h01 – 3 Different implementations (2) Server Client/Server
file1 file2 ... Client/Server file1 file2 ... Version Database version 2 version 1 version 1 ... Version Database version 2 version 1 version 1 ... Version Database version 2 version 1 version 1 ... Client/Server Decentralized • Optional: set up one repository as server only © 2016 AT Computing (CC BYNCND 4.0)
v2a – h01 – 4 History of git • September
30th 1998: Larry McVoy announces BitKeeper • 2002: decision is made to use BitKeeper for kernel development • April 2005: ◗ BitMover announced that it would stop providing a version of BitKeeper free of charge to the community ◗ Git development began as Linus Torvalds could not find any other that met his requirements • June 16th 2005: first kernel released using git (kernel 2.6.12) © 2016 AT Computing (CC BYNCND 4.0)
v2a – h01 – 5 Setting up a repository Command:
git init [options] [directory] • creates a new git repository • Examples: ◗ creating a new empty repository: ◗ Transforming an existing directory into a Git repository: $ git init my_app $ ls a my_app .git $ ls a my_app/.git branches config description HEAD hooks info objects refs $ cd my_old_app $ git init $ ls a README pingpong.c .git © 2016 AT Computing (CC BYNCND 4.0)
v2a – h01 – 6 Configure your Git environment Command:
git config [options] <variable> • configures your git installation • Stored in plaintext files ◗ per user (option global): .gitconfig in your homedir. ◗ per repository (option local) (default): <PROJECTDIR>/.git/config ◗ systemwide (option system): /etc/gitconfig • Examples ◗ Define the author name to be used for all commits ◗ Define the author email to be used for all commits $ git config global user.name “John Doe“ $ git config global user.email
[email protected]
© 2016 AT Computing (CC BYNCND 4.0)
v2a – h01 – 7 Adding files file1 file2 ...
git repository version 1 version 1 ... file1 file2 ... git repository Current situation Versioned situation Command: git add [options] <file|directory>... • add files to the staging area • Example: add a single file $ git add file1 file2 ... file1 file2 ... git repository file1 file2 ... Staged git add git commit © 2016 AT Computing (CC BYNCND 4.0)
v2a – h01 – 8 Committing the staged snapshot file1
file2 ... git repository version 1 version 1 ... file1 file2 ... git repository Current situation Versioned situation Command: git commit [options] [file]... • commit the staged snapshot • Example: $ git commit m "Initial commit" file1 file2 ... git repository file1 file2 ... Staged git add git commit © 2016 AT Computing (CC BYNCND 4.0)
v2a – h01 – 9 Lifecycle of file status Files
can be in one of the following four states Untracked Unmodified Modified Staged Add the file Edit the file Add the file Remove the file Commit © 2016 AT Computing (CC BYNCND 4.0)
v2a – h01 – 10 How Git stores versions 1a5c986b
ca85f079 753c4b26 compressed data compressed data compressed data 100644 blob 1a5c986b .gitignore 100644 blob ca85f079 Makefile 100644 blob 753c4b26 README 040000 tree 264626fa inc 040000 tree a2b93a56 snd 040000 tree bc4c62b7 src 100644 blob c3031628 ... 264626fa 100644 blob 70176522 ... 100644 blob 5c82d8e6 ... a2b93a56 100644 blob dcb49d7c ... 100644 blob c5a9c379 ... bc4c62b7 Tree object Blobs tree 753c4b26 parent 81f92422 author martijn <martijn... committer martijn <mart... Updated versionnumber Commit object 5a4eebb6 753c4b26 © 2016 AT Computing (CC BYNCND 4.0)
v2a – h01 – 11 Visualising the git commit history
• Each commit object contains a reference to the previous commit (except the first commit) ◗ Because of this visuals of a git history seems to go backwards ◗ HEAD points to last commit object ◗ master is a branch (more on that later) a38f278 3f5e909 81f9242 5a4eebb HEAD oldest newest master © 2016 AT Computing (CC BYNCND 4.0)
v2a – h01 – 12 Creating a branch Command: git
branch <name> [<commit/tag/branchname>] • List, create, or delete branches • Examples: ◗ Create a new branch from HEAD ◗ Create a new branch from a specific commit 2600f97 HEAD master $ git branch features/explbats features/explbats $ git branch customers/atc 81f9242 81f9242 customers/atc 81f9242 2600f97 HEAD master features/explbats © 2016 AT Computing (CC BYNCND 4.0)
v2a – h01 – 13 Merging a branch Command: git
merge <branchname> • Join two or more development histories together • Example: ◗ Merge customers/atc on master $ git checkout master Switched to branch 'master' ... $ git merge customers/atc Merge made by the 'recursive' strategy. src/engine.c | 4 ++++ src/main.c | 1 + 2 files changed, 5 insertions(+) 2600f97 HEAD master 81f9242 customers/atc 37f1803 2cc83bc • Performs a 3way merge • New commit has 2 parents 2600f97 master 81f9242 customers/atc 37f1803 HEAD after merge © 2016 AT Computing (CC BYNCND 4.0)
v2a – h01 – 14 Working together concurrently master ...
Jack/master master ... Anna/master master ... Jack/master master ... Jack/master $ git fetch Jack $ git merge Jack/master $ git fetch Anna master ... Jack/master Do not push, but pull updates in Anna Jack © 2016 AT Computing (CC BYNCND 4.0)
v2a – h01 – 15 Working together with many developers
Anna file1 file2 ... Version Database version 2 version 1 version 1 ... Jack file1 file2 ... Version Database version 2 version 1 version 1 ... Bob file1 file2 ... Version Database version 2 version 1 version 1 ... Alice file1 file2 ... Version Database version 2 version 1 version 1 ... © 2016 AT Computing (CC BYNCND 4.0)
v2a – h01 – 16 Problem with pushing updates master
... Jack/master master ... Anna/master $ git push Anna master master ... Jack/master • Anna's commit history updated without her knowledge $ git status On branch master nothing to commit, ... $ git status On branch master ... modified: README © 2016 AT Computing (CC BYNCND 4.0)
v2a – h01 – 17 Server Version Database version 2
version 1 version 1 ... Working with a central remote repository Jack's clone file1 file2 ... Version Database version 2 version 1 version 1 ... Anna's clone file1 file2 ... Version Database version 2 version 1 version 1 ... • Each developer fetches and pushes to the central server © 2016 AT Computing (CC BYNCND 4.0)
v2a – h01 – 18 Fastforward merge • Your master
branch • Remote's master branch • After you push remote's master branch 501f497 3c54c20 9a5ac52 6a59afb 501f497 HEAD master 6a59afb HEAD master HEAD master 501f497 3c54c20 9a5ac52 6a59afb © 2016 AT Computing (CC BYNCND 4.0)
v2a – h01 – 19 Working on remote branches •
Git does not allow you to work directly on remote branches. We therefore need to: 1. Create a new local branch 2. Connect local branch to a remote branch 3. Checkout local branch 4. Develop on local branch 5. Use push to update remote branch • Example • NOTE: Cloning automatically makes your local master track origin/master $ git branch bug/12 origin/bug/12 $ git checkout bug/12 … $ git commit $ git push © 2016 AT Computing (CC BYNCND 4.0)
v2a – h01 – 20 Centralized workflow • Uses a
single branch (usually master) • Rebase • Merge ... git clone git clone git push git pull rebase OR git pull master Central repository git push © 2016 AT Computing (CC BYNCND 4.0)
v2a – h01 – 21 bug/13 Longrunning branches: GitFlow develop
release0.9 feature/explodingbats master GitFlow model • Two long running main branches: Master and Develop • Arbitrary amount of support branches v0.1 v0.3 bug/12 v0.2 © 2016 AT Computing (CC BYNCND 4.0)
v2a – h01 – 22 Integrationmanager (forking) workflow • One
central repository serving the “official” project • Each developer has their own public repository • Only maintainer has push access to central repository • Developers ask maintainer to pull in their changes ... Central repository ... Anna's public repository ... Jack's public repository push push push pull pull Developer Developer Maintainer © 2016 AT Computing (CC BYNCND 4.0)
v2a – h01 – 23 Dictator and lieutenants workflow ...
Central repository ... Lieutenant Developer's public repository Lieutenant Dictator ... ... ... Developer's public repository Developer's public repository Developer's public repository © 2016 AT Computing (CC BYNCND 4.0)