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
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
120k
Statistics for Hackers
jakevdp
799
230k
Designing for Performance
lara
611
70k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
280
How to Think Like a Performance Engineer
csswizardry
28
2.7k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.6k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
390
Ethics towards AI in product and experience design
skipperchong
2
310
Abbi's Birthday
coloredviolet
3
8.2k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
1.8k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
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