aprendendo git - semana da tecnologia fatec 2016
TRANSCRIPT
rápido
design simples
poderoso suporte a
desenvolvimento não-linear
totalmente distribuído
capaz de atender
projetos gigantescos
statistics && highlights
> 35 milhões de projetos
> 14 milhões de pessoas
contribuindo ( ~ 70 maracanãs lotados)
> 600 eventosem >45 países até final de 2013
https://github.com/showcases/social-impacthttps://github.com/thieman/github-selfies
sudo apt-get update
sudo apt-get install git
ssh-keygen -t rsa -b 4096 -C "[email protected]"
eval "$(ssh-agent -s)" && ssh-add ~/.ssh/id_rsa
sudo apt-get updateatualiza lista de repositórios do apt-get
sudo apt-get install gitinstala git
ssh-keygen -t rsa -b 4096 -C "[email protected]"gera chave SSH
eval "$(ssh-agent -s)" && ssh-add ~/.ssh/id_rsainicializa ssh-agent e adiciona chave gerada anteriormente ao mesmo
cat ~/.ssh/id_rsa.pub mostra conteúdo da chave pública no terminal
ctrl+c maroto
https://github.com/settings/keys
new SSH key && ctrl+v malandro
addadiciona arquivos e alterações à staging area
git add README.md
git add .
git add **/*
git add carretafuracao.txt weezer.txt foo.js bar.py
commitcomita arquivos e alterações anteriormente adicionados à staging área com add
git commit -m "Inclui README em estado inicial"
git commit -m "Corrige divergência de valores na view foo"
git commit -m "Implementa testes pra nova funcionalidade fofao"
curta e objetiva
começar com letra maiúscula
não terminar com ponto final
começar com um verbo imperativo
http://chris.beams.io/posts/git-commit
showmostra os detalhes de um commit específico
git show
git show <numero do commit>
git show b1db67f
checkoutmuda de branch OU desfaz alterações em arquivos que ainda não foram adicionados à staging área
git checkout README.md
git checkout .
git checkout **/*
git checkout carretafuracao.txt weezer.txt foo.js bar.py
resetreseta estado da branch atual para o estado de um commit específico OU remove arquivos da staging área
git reset carretafuracao.txt
git reset <numero do commit>
git reset HEAD --hard
git reset 4a08b16
pushenvia alterações do branch atual pro branch remoto especificado
git push
git push origin dev
git push origin HEAD
fetchrealiza download de branches, tags e histórico remoto ou de alguma branch específica
git fetch
git fetch origin dev
git push origin HEAD
mergejunta um ou mais branches especificados no branch atual
git merge carreta-refactor
git merge carreta-refactor nova-funcionalidade
git merge origin carreta-refactor
pullrealiza fetch + merge do branch remoto especificado pro branch atual
git pull carreta-refactor
git pull carreta-refactor nova-funcionalidade
git pull origin carreta-refactor
branchlista, cria ou deleta branches
git branch -a
git branch <nome da nova branch a ser criada>
git branch carreta-refactor
git branch -D <nome da branch a ser deletada>
git branch -D carreta-refactor
checkoutmuda de branch OU desfaz alterações em arquivos que ainda não foram adicionados à staging área
git checkout <nome da branch>
git checkout carreta-refactor
git checkout -b <nome da branch a ser criada e alternada>
stashesconde as alterações pendentes atuais num diretório separado
git stash
git stash pop
git stash list
git stash show <numero da stash>
initcria um repositório vazio ou inicia um repositório existente
mkdir myRepository && cd myRepository && git init
git init myRepository
boas práticas &&
workflow
http://nvie.com/posts/a-successful-git-branching-model/
boas práticas &&
commit messages
http://chris.beams.io/posts/git-commit
documentação oficialhttps://git-scm.com/docs/git-init
https://github.com/thieman/github-selfies
contribuindoforks & pull requests
contribuindoissues & traduções
https://azkaban.github.io/contributing.html
python sorocaba - https://groups.google.com/forum/m/#!forum/python-sorocaba
guru sorocaba - https://www.facebook.com/GURUSorocaba/
hacklab - https://www.facebook.com/hacklabsorocaba/
GDG Sorocaba - https://www.facebook.com/GDGSorocaba/
SorocabaJS - https://www.facebook.com/sorocabajs/
JS Meetup - http://www.meetup.com/GDG-Sorocaba/
WomenTechmakers - https://www.facebook.com/groups/wtmsorocaba/
in.tegra.do - http://www.meetup.com/In-Tegra-Do/
english meetup - http://www.meetup.com/Sorocaba-English-Conversation-Happy-Hours/
#chegaMais