0% found this document useful (0 votes)
4 views80 pages

5 Git Contributingtoarepository 150928235649 Lva1 App6891

Rodrigo Branas provides a detailed guide on contributing to a Git repository, covering essential commands such as 'git push', 'git pull', and 'git merge'. He explains how to create a remote repository on GitHub and demonstrates various Git operations with practical examples. The document serves as a resource for understanding Git workflows and managing code contributions effectively.

Uploaded by

Otavio Costa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views80 pages

5 Git Contributingtoarepository 150928235649 Lva1 App6891

Rodrigo Branas provides a detailed guide on contributing to a Git repository, covering essential commands such as 'git push', 'git pull', and 'git merge'. He explains how to create a remote repository on GitHub and demonstrates various Git operations with practical examples. The document serves as a resource for understanding Git workflows and managing code contributions effectively.

Uploaded by

Otavio Costa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 80

Rodrigo Branas – @rodrigobranas - http://www.agilecode.com.

br

#5 - Git - Contribuindo com um repositório


Rodrigo Branas
rodrigo.branas@agilecode.com.br
http://www.agilecode.com.br

• Arquiteto de Software na Gennera


• Professor na Agile Code
• Autor na Java Magazine e PacktPub
• Palestrante
http://www.youtube.com/rodrigobranas
Push, ou empurrar, é a ação de
atualizar uma referência remota a partir
de uma referência local, enviando os
objetos necessários para satisfazer as
referências atualizadas.
git push
Cade o repositório remoto?
Fundado em 2008, o GitHub é a maior
plataforma de compartilhamento e
hospedagem de código do mundo com
10 milhões de usuários e mais de 20
milhões de repositórios.
Criando um repositório remoto...
git add remote origin https://github.com/
rodrigobranas/gitpresentation
git remote
git remote -v ou --verbose
git push origin master
Pull, ou puxar, é a ação de atualizar
uma referência local a partir de uma
referência remote, trazendo os objetos
necessários para satisfazer as
referências atualizadas.
git pull origin master
git clone https://github.com/rodrigobranas/
gitpresentation gitpresentation2
cd gitpresentation2
echo h > h.txt
git add -A
git commit -m "h.txt"
git push origin master
cd gitpresentation
git log --oneline --decorate --all --graph
git pull origin master
commit 270e
tree 82b4
HEAD master parent c85e
parent c5b5

commit c85e
tree a1bb
parent cc8a

commit cc8a
commit c5b5
tree 10e6
tree 82b4
parent d67a
parent cc8a
parent fde2
commit 119e
HEAD master tree 1e57 origin/master
parent 270e

commit 270e
tree 82b4
parent c85e
parent c5b5

commit c85e
tree a1bb
parent cc8a

commit cc8a
commit c5b5
tree 10e6
tree 82b4
parent d67a
parent cc8a
parent fde2
git log --oneline --decorate --all --graph
O comando git pull faz merge
automaticamente
cd gitpresentation2
echo i > i.txt
git add -A
git commit -m "i.txt"
git push origin master
cd presentation
git fetch
commit 119e
HEAD master tree 1e57 origin/master
parent 270e

commit 270e
tree 82b4
parent c85e
parent c5b5

commit c85e
tree a1bb
parent cc8a

commit cc8a
commit c5b5
tree 10e6
tree 82b4
parent d67a
parent cc8a
parent fde2
commit a4b1
tree 5ee6 origin/master
parent 119e

commit 119e
HEAD master tree 1e57
parent 270e

commit 270e
tree 82b4
parent c85e
parent c5b5

commit c85e
tree a1bb
parent cc8a

commit cc8a
commit c5b5
tree 10e6
tree 82b4
parent d67a
parent cc8a
parent fde2
git log --oneline --decorate --all --graph
git diff master origin/master
git merge origin/master
commit a4b1
tree 5ee6 origin/master
parent 119e

commit 119e
HEAD master tree 1e57
parent 270e

commit 270e
tree 82b4
parent c85e
parent c5b5

commit c85e
tree a1bb
parent cc8a

commit cc8a
commit c5b5
tree 10e6
tree 82b4
parent d67a
parent cc8a
parent fde2
commit a4b1
HEAD master tree 5ee6 origin/master
parent 119e

commit 119e
tree 1e57
parent 270e

commit 270e
tree 82b4
parent c85e
parent c5b5

commit c85e
tree a1bb
parent cc8a

commit cc8a
commit c5b5
tree 10e6
tree 82b4
parent d67a
parent cc8a
parent fde2
git log --oneline --decorate --all --graph
E se eu quiser apenas consultar
o repositório remoto?
cd gitpresentation2
echo j > j.txt
git add -A
git commit -m "j.txt"
git push origin master
cd gitpresentation
git ls-remote
git log --oneline --decorate --all --graph
git fetch
git log --oneline --decorate --all --graph
git merge origin/master
git log --oneline --decorate --all --graph
Rodrigo Branas
Site: http://www.agilecode.com.br
Twitter: @rodrigobranas
Facebook: http://www.facebook.com/canalrodrigobranas
SlideShare: http://www.slideshare.com/rodrigobranas
YouTube: http://www.youtube.com/rodrigobranas
LinkedIn: http://br.linkedin.com/in/rodrigobranas
+Plus: https://plus.google.com/+RodrigoBranas
GitHub: http://www.github.com/rodrigobranas

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy