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
De Basics Van Git - Koen Verburggen
Search
WPMeetup Antwerp
January 26, 2016
67
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
De Basics Van Git - Koen Verburggen
WPMeetup Antwerp
January 26, 2016
More Decks by WPMeetup Antwerp
See All by WPMeetup Antwerp
Dieter Vertessen: AdWords
wpmeetupantwerp
0
490
Responsive Images, srcset/sizes and WordPress by Jan Henckens
wpmeetupantwerp
0
320
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
870
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
200
Are puppies a ranking factor?
jonoalderson
1
3.6k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
560
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
160
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
300
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
240
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Into the Great Unknown - MozCon
thekraken
41
2.6k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Transcript
Git basis Koen Verbruggen WP Antwerp 18 jan 2016
[email protected]
https://ict.mind-heart-soul.org Git basis – TOC 1.Introductie 2.De 3 meest gebruikte commando's 3.Vanaf het begin 4.Branching / merging 5.Veranderingen bekijken
[email protected]
https://ict.mind-heart-soul.org
Introductie – versie beheer ↔ Git manueel
[email protected]
https://ict.mind-heart-soul.org 3
meest gebruikte commando's 1.git add . 2.git commit -am "documentatie" 3.git push origin master 1bis : git add --all > bij gewiste / verplaatste bestanden
[email protected]
https://ict.mind-heart-soul.org Vanaf het begin – config (1x) • git config --global user.name “vn an” • git config --global user.email “email” • git config --list
[email protected]
https://ict.mind-heart-soul.org Vanaf het begin – commando's 1.Server (ssh) git init --bare test.git 2.Lokaal (git bash) git clone ssh://user@host:/home/user/test.git geen server : i. mkdir test ii.cd test iii. git init
[email protected]
https://ict.mind-heart-soul.org
3 meest gebruikte commando's 1.git add . OF git add
--all 2.git commit -am "documentatie" 3.git push origin master herhaal ad infinitum
[email protected]
https://ict.mind-heart-soul.org Vanaf het begin – remote • Automatisch (host1 = “origin” remote) : git clone ssh://user1@host1:/home/user1/test.git > git push origin master • Manueel (host2 = “remote-name” remote) : 1.cd repo-name 2. git remote add remote-name ssh://user2@host2:/path/repo-name.git > git push remote-name master
[email protected]
https://ict.mind-heart-soul.org Git branching / merging • Kracht + complexiteit van git • Branching strategie nodig > Vele werkwijzes • Merging strategie nodig > Vele werkwijzes > Verschillende commando sequenties
[email protected]
https://ict.mind-heart-soul.org Git branching • Overzicht : git branch • Wisselen : git checkout branch-name • Nieuwe : git checkout -b branch-name – Maakt nieuwe branch – Gaat naar nieuwe branch • Delete : git branch -d branch-name > branch must be fully merged (-D)
[email protected]
https://ict.mind-heart-soul.org Git merging #make a branch the master 1.git checkout new-master 2.git merge -s ours master 3.git checkout master 4.git merge new-master 5.git commit -am "documentation"
[email protected]
https://ict.mind-heart-soul.org Veranderingen – geschiedenis # bekijk commits (exit “q”) • git log • git log -n 5 • git log --after=YYYY-MM-DD • git log file-name.ext • git log --name-status
[email protected]
https://ict.mind-heart-soul.org
Veranderingen – vergelijken # vergelijk bestanden (exit “q”) # SHA
hash : 40 hexadecimaal (6 eerste) • git diff • git diff SHA1 SHA2 • git diff file-name.ext • git diff --name-status
[email protected]
https://ict.mind-heart-soul.org Veranderingen – teruggaan # laatste commit ongedaan maken # werkt door nieuwe commit te maken → # vorige → → juist fout juist → volgende 1.git revert HEAD 2.git push origin master
[email protected]
https://ict.mind-heart-soul.org Veranderingen – undelete # herstel per ongeluk gewiste bestanden # toon overzicht van (D) bestanden 1.git checkout # specifiek bestand terughalen 2.git checkout file-name.ext
[email protected]
https://ict.mind-heart-soul.org Vragen ?
[email protected]
https://ict.mind-heart-soul.org