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
Git for Dummies
Search
Luca Simone
February 04, 2013
Programming
2
220
Git for Dummies
Presentazione in italiano sul version control system Git.
Luca Simone
February 04, 2013
Tweet
Share
More Decks by Luca Simone
See All by Luca Simone
I bet my mirror is smarter than yours
lukefx
0
53
GISDay 2015 - Web GIS @ ti.ch
lukefx
0
93
Git @ CSI
lukefx
0
62
Other Decks in Programming
See All in Programming
“あなた” の開発を支援する AI エージェント Bedrock Engineer / introducing-bedrock-engineer
gawa
11
1.8k
Formの複雑さに立ち向かう
bmthd
1
720
テストをしないQAエンジニアは何をしているか?
nealle
0
130
ペアーズでの、Langfuseを中心とした評価ドリブンなリリースサイクルのご紹介
fukubaka0825
2
300
チームリードになって変わったこと
isaka1022
0
190
How mixi2 Uses TiDB for SNS Scalability and Performance
kanmo
29
11k
Software Architecture
hschwentner
6
2.1k
AIの力でお手軽Chrome拡張機能作り
taiseiue
0
170
sappoRo.R #12 初心者セッション
kosugitti
0
230
Amazon ECS とマイクロサービスから考えるシステム構成
hiyanger
2
490
Open source software: how to live long and go far
gaelvaroquaux
0
620
GAEログのコスト削減
mot_techtalk
0
110
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.2k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
Music & Morning Musume
bryan
46
6.3k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.3k
Side Projects
sachag
452
42k
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
The Cost Of JavaScript in 2023
addyosmani
47
7.3k
Designing Experiences People Love
moore
139
23k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.1k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
Transcript
None
Perché abbiamo scelto git?
Alcuni comandi base init • Inizializza un nuovo repository all’interno
della cartella corrente • Crea la sottocartella .git che conterrà tutti i file ad uso interno di git
Alcuni comandi base clone • Clona un repository git esistente
Alcuni comandi base add • Aggiunge un nuovo file a
git, che da quel momento ne terrà traccia • Aggiunge un file modificato all’area di staging
git add nomefile
Alcuni comandi base commit • Memorizza lo snapshot delle modifiche
fatte • Obbligatorio inserire un messaggio • Identificato da hash SHA-1
Alcuni comandi base log • Mostra la storia dei commit
• Per ciascuno elenca autore e messaggio
Alcuni comandi base branch • Consente di continuare lo sviluppo
su una nuova feature senza impattare sul lavoro corrente • Fortemente utilizzato
Branching branch
Branching branch
Branching $ vi test.rb $ git add . $ git
commit -m modificato test.rb'
Alcuni comandi base checkout • Consente di passare da un
branch all’altra
Branching $ git checkout master
Alcuni comandi base merge • Incorpora nella branch corrente le
modifiche fatte su un altra branch • Assieme a branch, è un altro comando che git incentiva ad usare spesso
Branching $ git checkout master $ git merge iss55
Alcuni comandi base rebase • Altro modo per integrare le
modifiche di una branch • Prende linearmente tutte le modifiche fatte su una branch e le applica ad un altra
Branching $ git merge experiment $ git rebase experiment
Branching $ git merge experiment $ git rebase experiment Prende
gli ultimi commit e li «mette assieme», creando un nuovo commit di merge Applica le modifiche di una branch linearmente su un altra branch
Alcuni comandi base remote
Alcuni comandi base fetch • Scarica branch e dati da
un repository remoto
Alcuni comandi base pull • Scarica dati da un repository
remoto e tenta di fare il merge con il branch corrente • pull = fetch + merge
Alcuni comandi base push • Invia branch e dati ad
un repository remoto • Consente di aggiornare il repository remoto con le modifiche fatte localmente
Alcuni comandi base remote
Long-running branches master branch • Allineato con versione on-line develop
branch • Allineato con versione in sviluppo
Topic branches • Branch in cui sviluppare feature • Feature
terminata (e testata)? merge su develop • Al termine, il branch viene cancellato
Hotfix branches • Per bug fix / interventi veloci •
Fix terminato, merge su develop • Cancellato al termine del merge • Ha una vita molto breve
Best practices • Fare commit spesso • Aprire una pull
request il prima possibile • Un commit deve inglobare un insieme atomico di modifiche • NON lavorare N giorni in attesa di aver finito il task! • Al massimo fare tutti i commit alla fine, sfruttando lo staging
Utilizzo di Stash per gestire i repository
Testo del commit • Sommario da max 50 caratteri •
Seguito (eventualmente) da descrizione più dettagliata • Forma imperativa (es. «Add products section», ...)
Git workflow
Git workflow
Git workflow