Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Version Control - Eine Einführung
Search
Zoran Zaric
October 14, 2011
Programming
3
81
Version Control - Eine Einführung
Zoran Zaric
October 14, 2011
Tweet
Share
More Decks by Zoran Zaric
See All by Zoran Zaric
How FUTW does that Puppet Thing
zoranzaric
1
58
Kurt - An archiving tool
zoranzaric
0
63
bup: Git for backups
zoranzaric
2
180
Other Decks in Programming
See All in Programming
[SRE NEXT] 複雑なシステムにおけるUser Journey SLOの導入
yakenji
0
840
Bedrock AgentCore ObservabilityによるAIエージェントの運用
licux
8
430
LLMは麻雀を知らなすぎるから俺が教育してやる
po3rin
2
1.4k
「次に何を学べばいいか分からない」あなたへ──若手エンジニアのための学習地図
panda_program
3
670
Go製CLIツールをnpmで配布するには
syumai
0
840
JetBrainsのAI機能の紹介 #jjug
yusuke
0
120
The Niche of CDK Grant オブジェクトって何者?/the-niche-of-cdk-what-isgrant-object
hassaku63
1
720
CIを整備してメンテナンスを生成AIに任せる
hazumirr
0
330
Understanding Kotlin Multiplatform
l2hyunwoo
0
230
Streamlitで実現できるようになったこと、実現してくれたこと
ayumu_yamaguchi
2
240
Strands Agents で実現する名刺解析アーキテクチャ
omiya0555
1
110
Prompt Engineeringの再定義「Context Engineering」とは
htsuruo
0
110
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
2.9k
The Cost Of JavaScript in 2023
addyosmani
51
8.7k
Statistics for Hackers
jakevdp
799
220k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
Scaling GitHub
holman
461
140k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Making Projects Easy
brettharned
117
6.3k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
Designing Experiences People Love
moore
142
24k
It's Worth the Effort
3n
185
28k
Transcript
Version Control eine Einf¨ uhrung
Zoran Zari´ c 2007 Ausbildung zum Fachinformatiker f¨ ur Systemintegration
Informatik Student an der TU Darmstadt seit 2008 Git seit Mitte 2009 bup seit April 2010
toc 1. Fragen 2. Basics 3. Git 4. Beispiele /
Demo 5. Hintergr¨ unde 6. Tools
Fragen
Fragen 1. Wer weiß was Version Control ist?
Fragen 1. Wer weiß was Version Control ist? 2. Wer
kennt Subversion / CVS?
Fragen 1. Wer weiß was Version Control ist? 2. Wer
kennt Subversion / CVS? 3. Wer weiß was Distributed Version Control ist?
Fragen 1. Wer weiß was Version Control ist? 2. Wer
kennt Subversion / CVS? 3. Wer weiß was Distributed Version Control ist? 4. Wer kennt Git / Mercurial?
Fragen Version Control?
Fragen $ echo "Halo Wlet!" > README $ mkdir v0.1
$ mv README v0.1 $ echo "Hallo Welt!" > README
Fragen Distributed Version Control?
Fragen $ echo "Hier die bestimmt finale Version unseres Codes"
\ | mail -s "Code final, echt jetzt" -a main.c
[email protected]
Git “stupid content tracker” “content addressable” Verteiltes Versionierungssystem Vollst¨ andige
Kopie des Repositories lokal lokales Committen, Branchen, Mergen Linus Torvalds begann Entwicklung 2005 Snapshot- statt Diff-basiert
Fragen Diffs? Snapshots?
Fragen Diffs? Snapshots? Diffs (Subversion) $ cat foo.1 Halo Wlet!
$cat foo.2.diff 1c1 < Halo Wlet! --- > Hallo Welt! $patch foo.1 -o - < foo.2.diff patching file foo.1 Hallo Welt! Snapshots (Git) $ cat foo.1 Halo Wlet! $cat foo.2 Hallo Welt!
Installation Windows mysysgit http://code.google.com/p/msysgit/ TortoiseGit http://code.google.com/p/tortoisegit/ Ubuntu aptitude install git
OSX http://code.google.com/p/git-osx-installer/
Beispiele Config $ git config user.name "Zoran Zaric" $ git
config user.email "
[email protected]
"
Beispiele Erste Schritte $ git init $ echo "Halo Wlet!"
> README $ git add README $ git commit -m "Initial import" # (1) $ git log $ echo "Hallo Welt!" > README $ git add README $ git commit -m "Fix spelling errors" # (2) $ git log 2 1
Beispiele Branchen und Mergen $ git status # On branch
master $ git checkout -b new-branch $ git branch $ echo "Lorem ipsum" >> README $ git add README $ commit -m "Add noise" # (3) $ git diff master $ git checkout master $ git merge new-branch $ git branch -d new-branch 3 2 1
¨ A¨ a¨ a¨ ahm! war da nicht was mit
distributed?!1elf
Beispiele Remotes $ git clone https://github.com/apenwarr/bup.git $ git remote rename
origin upstream # ¨ Anderungen holen $ git fetch upstream $ git merge upstream/master # ¨ Anderungen hochladen $ git push upstream master
Aber, aber. . . upstream sind ¨ Anderungen und ich
habe ¨ Anderungen. . . und. . . und. . . jetzt?
Beispiele Rebase # Lokale ¨ Anderungen auf Basis # von
upstream/master $ echo "..." >> README $ git add README $ git commit -m "..." # (3) # ¨ Anderungen holen $ git fetch upstream # (4) 4 3 2 1
Beispiele Rebase # Lokale ¨ Anderungen auf Basis # von
upstream/master $ echo "..." >> README $ git add README $ git commit -m "..." # (3) # ¨ Anderungen holen $ git fetch upstream # (4) # Eigene ¨ Anderungen auf Upstream # anwenden $ git rebase upstream/master 4 3 2 1
Basics SHA1 DAG (Directed Acyclic Graph) gerichteter zyklenfreier Graph
Ein Repository BLOBs e69de29 Hello World
Ein Repository BLOBs e69de29 Trees 82e3a75 100644 blob 5e1c309dae7f45e0f39b1bf3ac3cd9db12e7 README
Ein Repository BLOBs e69de29 Trees 82e3a75 Commits 3dfe461f tree a3d703e579dc9baae20456eb63fa49f5e4e
author Zoran Zaric <
[email protected]
>1314498536 +0200 committer Zoran Zaric <
[email protected]
>1314498536 +0200 Example commit
Ein Repository BLOBs e69de29 Trees 82e3a75 Commits 3dfe461f Tags &
Branches v0.1 master
Ein Repository BLOBs e69de29 Trees 82e3a75 Commits 3dfe461f Tags &
Branches v0.1 master 3dfe461f 82e3a75 e69de29 25b2be3 78af04f 41c28e8 master v1.0
Ein Repository DAG Directed Acyclic Graph 3dfe461f init 25b2be3 master
v0.1 abcdef dev
Ein Repository DAG Directed Acyclic Graph Packfiles e69de29 82e3a75 3dfe461f
41c28e8 78af04f 25b2be3
Tools
Tools Tig gitk gitg Tower Git gitkx
Weiterf¨ uhrendes / Nachschlagewerk http://progit.org/ http://gitref.org/ http://sea.ucar.edu/event/unlocking-secrets-git http://blip.tv/scott-chacon
Danke zorzar auf freenode & hackint
[email protected]
(Email & Jabber)
zoranzaric.de github.com/zoranzaric gplus.zoranzaric.de @zoranzaric Slides: zoranzaric.de/git-ophase1112.pdf