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
そのAPI、誰のため? Androidライブラリ設計における利用者目線の実践テクニック
mkeeda
2
310
RDoc meets YARD
okuramasafumi
4
170
Navigating Dependency Injection with Metro
zacsweers
3
960
HTMLの品質ってなんだっけ? “HTMLクライテリア”の設計と実践
unachang113
4
2.9k
アルテニア コンサル/ITエンジニア向け 採用ピッチ資料
altenir
0
110
AIを活用し、今後に備えるための技術知識 / Basic Knowledge to Utilize AI
kishida
22
5.8k
はじめてのMaterial3 Expressive
ym223
2
740
AIでLINEスタンプを作ってみた
eycjur
1
230
print("Hello, World")
eddie
2
530
ユーザーも開発者も悩ませない TV アプリ開発 ~Compose の内部実装から学ぶフォーカス制御~
taked137
0
180
AIコーディングAgentとの向き合い方
eycjur
0
270
How Android Uses Data Structures Behind The Scenes
l2hyunwoo
0
460
Featured
See All Featured
Producing Creativity
orderedlist
PRO
347
40k
Navigating Team Friction
lara
189
15k
Raft: Consensus for Rubyists
vanstee
140
7.1k
Documentation Writing (for coders)
carmenintech
74
5k
Agile that works and the tools we love
rasmusluckow
330
21k
Intergalactic Javascript Robots from Outer Space
tanoku
272
27k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
36
2.5k
Scaling GitHub
holman
463
140k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
580
Large-scale JavaScript Application Architecture
addyosmani
512
110k
The Straight Up "How To Draw Better" Workshop
denniskardys
236
140k
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