git
TRANSCRIPT
![Page 1: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/1.jpg)
Controle de Versão
Alexandre Uehara
![Page 2: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/2.jpg)
GIT
Controle de
versão
distribuído
![Page 3: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/3.jpg)
GIT
Projetado e
desenvolvido
por Linus
Torvalds para o
desenvolvimento
do kernel Linux
![Page 4: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/4.jpg)
Por que usar
o GIT?
Vantagens...
![Page 5: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/5.jpg)
● Controle de versão distribuído (pode
trabalhar offline)
● Free e Open Source
● Multi Plataforma (Windows, Linux, Mac)
![Page 6: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/6.jpg)
● Branching & Merging
● Pequeno e Rápido
● Documentação
![Page 7: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/7.jpg)
Adoção
![Page 8: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/8.jpg)
Projetos e
Empresas que
usam o GIT
![Page 9: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/9.jpg)
![Page 10: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/10.jpg)
![Page 11: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/11.jpg)
GIT
Integração
![Page 12: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/12.jpg)
● Jenkins / Hudson
● Redmine, etc...
![Page 13: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/13.jpg)
Entendendo
melhor
o GIT
![Page 14: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/14.jpg)
GIT x SVN
![Page 15: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/15.jpg)
GIT - descentralizado
![Page 16: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/16.jpg)
Áreas do GIT
![Page 17: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/17.jpg)
Principais
comandos
![Page 18: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/18.jpg)
//Iniciar um projeto
git init
//Obter um projeto
git clone
/caminho/para/o/repositório
git clone usuário@servidor:
/caminho/para/o/repositório
![Page 19: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/19.jpg)
//Adicionar no index(stage)
git add <arquivo>
//Comentários / Enviar para o HEAD
git commit -m "comentários das
alterações"
![Page 20: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/20.jpg)
//Enviar para o servidor
(repositório) remoto
git push origin master
//Adicionar repositório remoto
git remote add origin <servidor>
![Page 21: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/21.jpg)
![Page 22: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/22.jpg)
//Atualizar repositório local
git pull
//Exemplo: Atualizar repositório
local
git pull origin master
//Diferenças
git diff <branch origem> <branch
destino>
![Page 23: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/23.jpg)
GIT Branch
![Page 24: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/24.jpg)
//Criar um branch e usá-lo
git checkout -b funcionalidade_x
//Usar o branch master
git checkout master
//Merge entre branches
git merge <branch>
![Page 25: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/25.jpg)
![Page 26: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/26.jpg)
Outros
Comandos
Úteis
![Page 27: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/27.jpg)
//Criar Tag
git tag 1.0.0
//Ver Log
git log
![Page 28: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/28.jpg)
![Page 29: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/29.jpg)
Quanta
linha de
comando….
E agora?
![Page 30: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/30.jpg)
Não tenha medo!
Temos a solução!
![Page 31: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/31.jpg)
1) Plugins
![Page 32: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/32.jpg)
Plugins
● Eclipse
● Visual Studio
● TFS
![Page 33: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/33.jpg)
Plugins
● TortoiseGIT (Windows)
![Page 34: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/34.jpg)
Plugins
● TortoiseGIT (Windows)
![Page 35: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/35.jpg)
2) Interface
Gráfica
![Page 37: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/37.jpg)
![Page 38: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/38.jpg)
ATENÇÃO
![Page 39: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/39.jpg)
● Não “commitar” arquivos
compilados
● .gitignore
● Sempre “commitar” versões
estáveis
ATENÇÃO
![Page 40: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/40.jpg)
● Nunca “commitar” versão que roda “só
na sua máquina”
● Colocar sempre comentários
relevantes, e não coisas como:
git commit -m “Bug arrumado”
ou
git commit -m “Nova versão”
ATENÇÃO
![Page 41: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/41.jpg)
Onde aprender
mais sobre
GIT?
![Page 42: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/42.jpg)
Video:
Começando com GIT
http://blip.
tv/akitaonrails/screencast
-come-ando-com-git-
6074964
![Page 43: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/43.jpg)
Video:
Começando com GIT
http://blip.
tv/akitaonrails/screencast
-come-ando-com-git-
6074964
![Page 44: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/44.jpg)
Curso 15 min:
Code School
http://try.github.
io/levels/1/challenges/1
![Page 45: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/45.jpg)
Curso 15 min:
Code School
http://try.github.
io/levels/1/challenges/1
![Page 46: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/46.jpg)
Livro:
Pro GIT
http://git-scm.com/book
![Page 47: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/47.jpg)
Livro:
Pro GIT
http://git-scm.com/book
![Page 48: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/48.jpg)
E a melhor dica:Github
https://github.com/
![Page 49: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/49.jpg)
E a melhor dica:Github
https://github.com/
![Page 50: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/50.jpg)
Endereço GIT:
https://git.ns2online.com.
br/projects
![Page 51: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/51.jpg)
Fontes:
http://git-scm.com/about
http://pt.wikipedia.
org/wiki/Git
http://www.thoughtworks.
com/articles/technology-
radar-march-2012
![Page 52: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/52.jpg)
Fontes:
https://www.atlassian.
com/git/workflows
![Page 53: Git](https://reader035.vdocuments.pub/reader035/viewer/2022062319/556154c6d8b42aa20d8b51f5/html5/thumbnails/53.jpg)
Alexandre Uehara
@AleUehara
linkedin.com/in/aleuehara
slideshare.net/aleuehara