Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
Git lightning talk
Caio Gondim
January 11, 2013
Programming
5
240
Git lightning talk
Boas práticas e alguns atalhos
Caio Gondim
January 11, 2013
Tweet
Share
More Decks by Caio Gondim
See All by Caio Gondim
caiogondim
1
71
caiogondim
9
590
caiogondim
3
180
caiogondim
1
73
caiogondim
5
260
caiogondim
21
2.4k
caiogondim
2
280
caiogondim
5
220
caiogondim
3
790
Other Decks in Programming
See All in Programming
siketyan
1
110
akatsukinewgrad
0
210
saki4869
0
190
rishitdagli
0
180
kubode
0
210
horie1024
1
390
kyonmm
2
2.1k
cwozaki
1
1.9k
yagitatsu
3
1.5k
itosho525
0
140
line_developers_tw2
0
120
nbkouhou
1
1.2k
Featured
See All Featured
ufuk
56
5.4k
dougneiner
55
5.4k
dotmariusz
94
5.1k
frogandcode
127
20k
destraynor
223
47k
addyosmani
310
21k
jasonvnalue
82
8.1k
danielanewman
200
20k
trishagee
20
2.1k
carmenhchung
26
1.3k
kneath
294
39k
qrush
285
18k
Transcript
lightning talk
branches
branches • branch de desenvolvimento • syncar código entre devs
dev
branches • branch de teste • merge da dev •
teste para produção • ambiente similar ao de produção staging
branches • código de produção • código homolagado em staging
• merge da staging production
branches • feature que vai levar mais de um commit
• algo que pode quebrar alguma branch • manter a sua bagunça separada branch X
branches • $ git branch -a listar branches
branches • $ git checkout --orphan nova_branch • branch sem
pai • bom para arquivos de suporte, design, ... branch orfã
log
log • $ git log --name-only log do repositório
log • $ git log filename log de um arquivo
log • $ git show commitID --name-only detalhes de um
commit
blame
blame • $ git blame filename • mostra quem inseriu
cada linha blame de arquivo
blame • $ git blame -L 10,20 filename • limita
entre as linhas 10 e 20 blame de arquivo entre linhas
reverter mudanças
reverter mudanças • $ git clean -f • deixa repositório
idêntico ao último commit • deleta arquivos limpar repositório
reverter mudanças • $ git checkout commitID voltar para commit
antigo
commit messages
commit messages • resumo < 80 char • nova linha
• descrição completa • msg no presente perfeito Boas práticas
commit messages • $ vi ~/.gitconfig • [core] editor =
subl -n -w Sublime Text
amend
amend • Altera último commit • Para pequenos fixes •
Inserir arquivo esquecido • Não gera um commit desnecessário Mantendo o log limpo
amend • $ git commit --amend • $ git push
-f Comandos
conflitos
conflitos • Instale o Xcode pela Mac App Store •
$ git config --global merge.tool opendiff • $ git config --global diff.tool opendiff FileMerge no OS X
conflitos FileMerge no OS X
atalhos
atalhos •http://loopinfinito.com.br/2012/12/13/ atalhos-do-git/ •http://d.pr/2VMU Atalhos úteis