mini-curso de git -- secomp-ufs
TRANSCRIPT
![Page 1: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/1.jpg)
Controle de Versao com git
Felipe Oliveira Carvalho
Universidade Federal de Sergipe
6 de Outubro, 2011
1 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 2: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/2.jpg)
1 IntroducaoO que e controle de versao?O que e git?
2 Introducao ao gitPrimeiros passosRepositoriosWorkflow basicoObtendo ajudaVisualizando o historico do repositorio
3 Branching e MergingArmazenamento de commitsBranchesDesenvolvimento nao-linearResolvendo conflitos de merge
4 git no servidorIntroducaoTrabalhando em grupo
5 Extras
2 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 3: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/3.jpg)
Introducao – O que e controle de versao?
O que e controle de versao?
Controle de versao e um sistema que grava as mudancas feitas emum conjunto de arquivos ao longo do tempo de uma forma quevoce possa restaurar e comparar versoes especıficas depois.
Tipos de controle de versao:
Controle de versao local
Controle de versao centralizado
Controle de versao distribuıdo
3 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 4: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/4.jpg)
Introducao – O que e controle de versao?
O que e controle de versao?
Controle de versao e um sistema que grava as mudancas feitas emum conjunto de arquivos ao longo do tempo de uma forma quevoce possa restaurar e comparar versoes especıficas depois.Tipos de controle de versao:
Controle de versao local
Controle de versao centralizado
Controle de versao distribuıdo
3 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 5: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/5.jpg)
Introducao – O que e controle de versao?
Controle de versao local
4 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 6: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/6.jpg)
Introducao – O que e controle de versao?
Controle de versao centralizado
5 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 7: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/7.jpg)
Introducao – O que e controle de versao?
Controle de versao distribuıdo
6 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 8: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/8.jpg)
Introducao – O que e git?
O que e git?
Git e um sistema de controle deversao distribuıdo projetado para
ser eficiente.
7 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 9: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/9.jpg)
Introducao – O que e git?
Breve historia
Criado por Linus Torvalds em 2005
Para ser usado no desenvolvimento do Linux kernel
Metas dos projeto:
VelocidadeDesign simplesPermitir desenvolvimento nao-linear (milhares de branches)Capaz de manipular projetos grandes como o Linux kernel demaneira eficiente
8 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 10: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/10.jpg)
1 IntroducaoO que e controle de versao?O que e git?
2 Introducao ao gitPrimeiros passosRepositoriosWorkflow basicoObtendo ajudaVisualizando o historico do repositorio
3 Branching e MergingArmazenamento de commitsBranchesDesenvolvimento nao-linearResolvendo conflitos de merge
4 git no servidorIntroducaoTrabalhando em grupo
5 Extras
9 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 11: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/11.jpg)
Introducao ao git – Primeiros passos
Instalacao
http://git-scm.com
10 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 12: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/12.jpg)
Introducao ao git – Primeiros passos
Configurando
$ git config --global user.name "Felipe O. Carvalho"
$ git config --global user.email "[email protected]"
11 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 13: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/13.jpg)
Introducao ao git – Repositorios
Criando um repositorio
git init
$ mkdir hello_git
$ cd hello_git/
$ git init
Initialized empty Git repository in /home/felipe/hello_git/.git/
$ ls -a
. .. .git
12 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 14: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/14.jpg)
Introducao ao git – Repositorios
Primeiro commit
git add
git commit
$ touch hello_world.py
$ git add hello_world.py
$ git commit -m "Primeiro commit"
13 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 15: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/15.jpg)
Introducao ao git – Repositorios
Primeiro commit
$ git show
commit 9b302737d41712809ca455b1d522c334793ef001
Author: Felipe Oliveira Carvalho <[email protected]>
Date: Sun Oct 2 15:45:23 2011 -0300
Primeiro commit
diff --git a/hello_world.py b/hello_world.py
new file mode 100644
index 0000000..e69de29
14 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 16: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/16.jpg)
Introducao ao git – Repositorios
Primeiro commit
$ git show
commit 9b302737d41712809ca455b1d522c334793ef001
Author: Felipe Oliveira Carvalho <[email protected]>
Date: Sun Oct 2 15:45:23 2011 -0300
Primeiro commit
diff --git a/hello_world.py b/hello_world.py
new file mode 100644
index 0000000..e69de29
14 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 17: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/17.jpg)
Introducao ao git – Repositorios
Clonando um Repositorio
git clone
$ git clone git://github.com/schacon/ticgit.git
Cloning into ticgit...
remote: Counting objects: 1857, done.
remote: Compressing objects: 100% (826/826), done.
remote: Total 1857 (delta 969), reused 1796 (delta 931)
Receiving objects: 100% (1857/1857), 269.46 KiB | 143 KiB/s, done.
Resolving deltas: 100% (969/969), done.
$ cd ticgit
$ ls
bin examples lib LICENSE_GPL LICENSE_MIT note Rakefile
README.mkd spec ticgit-ng.gemspec TODO
15 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 18: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/18.jpg)
Introducao ao git – Repositorios
Clonando um Repositorio
git clone
$ git clone git://github.com/schacon/ticgit.git
Cloning into ticgit...
remote: Counting objects: 1857, done.
remote: Compressing objects: 100% (826/826), done.
remote: Total 1857 (delta 969), reused 1796 (delta 931)
Receiving objects: 100% (1857/1857), 269.46 KiB | 143 KiB/s, done.
Resolving deltas: 100% (969/969), done.
$ cd ticgit
$ ls
bin examples lib LICENSE_GPL LICENSE_MIT note Rakefile
README.mkd spec ticgit-ng.gemspec TODO
15 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 19: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/19.jpg)
Introducao ao git – Repositorios
Clonando um Repositorio
git clone
$ git clone git://github.com/schacon/ticgit.git
Cloning into ticgit...
remote: Counting objects: 1857, done.
remote: Compressing objects: 100% (826/826), done.
remote: Total 1857 (delta 969), reused 1796 (delta 931)
Receiving objects: 100% (1857/1857), 269.46 KiB | 143 KiB/s, done.
Resolving deltas: 100% (969/969), done.
$ cd ticgit
$ ls
bin examples lib LICENSE_GPL LICENSE_MIT note Rakefile
README.mkd spec ticgit-ng.gemspec TODO
15 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 20: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/20.jpg)
Introducao ao git – Repositorios
Clonando um Repositorio
git clone
$ git clone git://github.com/schacon/ticgit.git
Cloning into ticgit...
remote: Counting objects: 1857, done.
remote: Compressing objects: 100% (826/826), done.
remote: Total 1857 (delta 969), reused 1796 (delta 931)
Receiving objects: 100% (1857/1857), 269.46 KiB | 143 KiB/s, done.
Resolving deltas: 100% (969/969), done.
$ cd ticgit
$ ls
bin examples lib LICENSE_GPL LICENSE_MIT note Rakefile
README.mkd spec ticgit-ng.gemspec TODO
15 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 21: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/21.jpg)
Introducao ao git – Repositorios
Clonando um Repositorio
git clone
$ git clone git://github.com/schacon/ticgit.git
Cloning into ticgit...
remote: Counting objects: 1857, done.
remote: Compressing objects: 100% (826/826), done.
remote: Total 1857 (delta 969), reused 1796 (delta 931)
Receiving objects: 100% (1857/1857), 269.46 KiB | 143 KiB/s, done.
Resolving deltas: 100% (969/969), done.
$ cd ticgit
$ ls
bin examples lib LICENSE_GPL LICENSE_MIT note Rakefile
README.mkd spec ticgit-ng.gemspec TODO
15 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 22: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/22.jpg)
Introducao ao git – Repositorios
gitk
16 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 23: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/23.jpg)
Introducao ao git – Workflow basico
Workflow basico
Editar arquivos
– Eclipse, Visual Studio, Notepad++, emacs,vim... Photoshop...
Adicionar as mudancas ao index (tambem conhecido como stagingarea – git add, git rm, git reset...
Revisar as mudancas – git status, git diff...
Fazer o commit das mudancas – git commit -m ”Mensagem”
17 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 24: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/24.jpg)
Introducao ao git – Workflow basico
Workflow basico
Editar arquivos – Eclipse, Visual Studio, Notepad++, emacs,vim... Photoshop...
Adicionar as mudancas ao index (tambem conhecido como stagingarea – git add, git rm, git reset...
Revisar as mudancas – git status, git diff...
Fazer o commit das mudancas – git commit -m ”Mensagem”
17 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 25: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/25.jpg)
Introducao ao git – Workflow basico
Workflow basico
Editar arquivos – Eclipse, Visual Studio, Notepad++, emacs,vim... Photoshop...
Adicionar as mudancas ao index (tambem conhecido como stagingarea
– git add, git rm, git reset...
Revisar as mudancas – git status, git diff...
Fazer o commit das mudancas – git commit -m ”Mensagem”
17 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 26: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/26.jpg)
Introducao ao git – Workflow basico
Workflow basico
Editar arquivos – Eclipse, Visual Studio, Notepad++, emacs,vim... Photoshop...
Adicionar as mudancas ao index (tambem conhecido como stagingarea – git add, git rm, git reset...
Revisar as mudancas – git status, git diff...
Fazer o commit das mudancas – git commit -m ”Mensagem”
17 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 27: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/27.jpg)
Introducao ao git – Workflow basico
Workflow basico
Editar arquivos – Eclipse, Visual Studio, Notepad++, emacs,vim... Photoshop...
Adicionar as mudancas ao index (tambem conhecido como stagingarea – git add, git rm, git reset...
Revisar as mudancas – git status, git diff...
Fazer o commit das mudancas – git commit -m ”Mensagem”
17 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 28: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/28.jpg)
Introducao ao git – Workflow basico
Workflow basico
Editar arquivos – Eclipse, Visual Studio, Notepad++, emacs,vim... Photoshop...
Adicionar as mudancas ao index (tambem conhecido como stagingarea – git add, git rm, git reset...
Revisar as mudancas – git status, git diff...
Fazer o commit das mudancas – git commit -m ”Mensagem”
17 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 29: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/29.jpg)
Introducao ao git – Workflow basico
Os tres passos
18 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 30: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/30.jpg)
Introducao ao git – Workflow basico
Os tres passos
$ vim hello_world.py
$ cat hello_world.py
print "Hell World!"
$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: hello_world.py
#
no changes added to commit (use "git add" and/or "git commit -a")
19 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 31: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/31.jpg)
Introducao ao git – Workflow basico
Os tres passos
$ vim hello_world.py
$ cat hello_world.py
print "Hell World!"
$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: hello_world.py
#
no changes added to commit (use "git add" and/or "git commit -a")
19 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 32: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/32.jpg)
Introducao ao git – Workflow basico
Os tres passos
$ vim hello_world.py
$ cat hello_world.py
print "Hell World!"
$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: hello_world.py
#
no changes added to commit (use "git add" and/or "git commit -a")
19 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 33: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/33.jpg)
Introducao ao git – Workflow basico
Os tres passos
$ vim hello_world.py
$ cat hello_world.py
print "Hell World!"
$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: hello_world.py
#
no changes added to commit (use "git add" and/or "git commit -a")
19 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 34: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/34.jpg)
Introducao ao git – Workflow basico
Os tres passos
Voce tem que adicionar o arquivo aoindex depois de edita-lo e/ou cria-lo.
20 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 35: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/35.jpg)
Introducao ao git – Workflow basico
Os tres passos
workingdirectory
staging area(index)
git directory(repository)
git commit
git add
21 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 36: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/36.jpg)
Introducao ao git – Workflow basico
Os tres passos
$ git add hello_world.py
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: hello_world.py
#
$ git commit -m "Hello World em Python"
[master e3d5175] Hello World em Python
1 files changed, 1 insertions(+), 0 deletions(-)
$ git status
# On branch master
nothing to commit (working directory clean)
22 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 37: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/37.jpg)
Introducao ao git – Workflow basico
Os tres passos
$ git add hello_world.py
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: hello_world.py
#
$ git commit -m "Hello World em Python"
[master e3d5175] Hello World em Python
1 files changed, 1 insertions(+), 0 deletions(-)
$ git status
# On branch master
nothing to commit (working directory clean)
22 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 38: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/38.jpg)
Introducao ao git – Workflow basico
Os tres passos
$ git add hello_world.py
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: hello_world.py
#
$ git commit -m "Hello World em Python"
[master e3d5175] Hello World em Python
1 files changed, 1 insertions(+), 0 deletions(-)
$ git status
# On branch master
nothing to commit (working directory clean)
22 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 39: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/39.jpg)
Introducao ao git – Workflow basico
Os tres passos
$ git add hello_world.py
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: hello_world.py
#
$ git commit -m "Hello World em Python"
[master e3d5175] Hello World em Python
1 files changed, 1 insertions(+), 0 deletions(-)
$ git status
# On branch master
nothing to commit (working directory clean)
22 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 40: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/40.jpg)
Introducao ao git – Workflow basico
Os tres passos
$ git add hello_world.py
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: hello_world.py
#
$ git commit -m "Hello World em Python"
[master e3d5175] Hello World em Python
1 files changed, 1 insertions(+), 0 deletions(-)
$ git status
# On branch master
nothing to commit (working directory clean)
22 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 41: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/41.jpg)
Introducao ao git – Workflow basico
Os tres passos
$ git log
commit e3d5175ca59febe510b1e0689040d2702b08c7ee
Author: Felipe Oliveira Carvalho <[email protected]>
Date: Sun Oct 2 17:36:41 2011 -0300
Hello World em Python
commit 9b302737d41712809ca455b1d522c334793ef001
Author: Felipe Oliveira Carvalho <[email protected]>
Date: Sun Oct 2 15:45:23 2011 -0300
Primeiro commit
23 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 42: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/42.jpg)
Introducao ao git – Workflow basico
Comandos vistos ate agora
git config Utilitario de configuracao
git init Cria um novo repositoriogit clone Clona um repositorio existente
git status Mostra o estado do diretorio de trabalho e index
git add Adiciona arquivos ao indexgit commit Faz o commit das mudancas no indexgit show Mostra detalhes do ultimo commit
git log Lista os commits
24 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 43: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/43.jpg)
Introducao ao git – Workflow basico
Comandos vistos ate agora
git config Utilitario de configuracao
git init Cria um novo repositoriogit clone Clona um repositorio existente
git status Mostra o estado do diretorio de trabalho e index
git add Adiciona arquivos ao indexgit commit Faz o commit das mudancas no indexgit show Mostra detalhes do ultimo commit
git log Lista os commits
24 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 44: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/44.jpg)
Introducao ao git – Workflow basico
Comandos vistos ate agora
git config Utilitario de configuracao
git init Cria um novo repositoriogit clone Clona um repositorio existente
git status Mostra o estado do diretorio de trabalho e index
git add Adiciona arquivos ao indexgit commit Faz o commit das mudancas no indexgit show Mostra detalhes do ultimo commit
git log Lista os commits
24 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 45: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/45.jpg)
Introducao ao git – Workflow basico
Comandos vistos ate agora
git config Utilitario de configuracao
git init Cria um novo repositoriogit clone Clona um repositorio existente
git status Mostra o estado do diretorio de trabalho e index
git add Adiciona arquivos ao indexgit commit Faz o commit das mudancas no indexgit show Mostra detalhes do ultimo commit
git log Lista os commits
24 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 46: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/46.jpg)
Introducao ao git – Workflow basico
Comandos vistos ate agora
git config Utilitario de configuracao
git init Cria um novo repositoriogit clone Clona um repositorio existente
git status Mostra o estado do diretorio de trabalho e index
git add Adiciona arquivos ao indexgit commit Faz o commit das mudancas no indexgit show Mostra detalhes do ultimo commit
git log Lista os commits
24 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 47: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/47.jpg)
Introducao ao git – Workflow basico
Untracked, Unmodified, Modified eStaged
25 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 48: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/48.jpg)
Introducao ao git – Workflow basico
Untracked, Unmodified, Modified eStaged
$ git status
# On branch master
nothing to commit (working directory clean)
$ vim README
Untracked
$ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# README
nothing added to commit but untracked files present (use "git add" to track)
26 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 49: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/49.jpg)
Introducao ao git – Workflow basico
Untracked, Unmodified, Modified eStaged
$ git status
# On branch master
nothing to commit (working directory clean)
$ vim README
Untracked
$ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# README
nothing added to commit but untracked files present (use "git add" to track)
26 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 50: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/50.jpg)
Introducao ao git – Workflow basico
Untracked, Unmodified, Modified eStaged
$ git status
# On branch master
nothing to commit (working directory clean)
$ vim README
Untracked
$ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# README
nothing added to commit but untracked files present (use "git add" to track)
26 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 51: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/51.jpg)
Introducao ao git – Workflow basico
Untracked, Unmodified, Modified eStaged
$ git add README
Staged
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: README
#
27 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 52: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/52.jpg)
Introducao ao git – Workflow basico
Untracked, Unmodified, Modified eStaged
$ git add README
Staged
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: README
#
27 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 53: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/53.jpg)
Introducao ao git – Workflow basico
Untracked, Unmodified, Modified eStaged
$ vim hello_git.py
Staged, Modified
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: README
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: hello_world.py
#
28 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 54: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/54.jpg)
Introducao ao git – Workflow basico
Untracked, Unmodified, Modified eStaged
$ vim hello_git.py
Staged, Modified
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: README
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: hello_world.py
#
28 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 55: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/55.jpg)
Introducao ao git – Workflow basico
Untracked, Unmodified, Modified eStaged
$ git add hello_world.py
Staged
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: README
# modified: hello_world.py
#
29 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 56: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/56.jpg)
Introducao ao git – Workflow basico
Untracked, Unmodified, Modified eStaged
$ git add hello_world.py
Staged
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: README
# modified: hello_world.py
#
29 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 57: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/57.jpg)
Introducao ao git – Workflow basico
Untracked, Unmodified, Modified eStaged
$ git commit -m "README e mudancas no Hello World"
[master 2b32cb9] README e mudancas no Hello World
1 files changed, 1 insertions(+), 1 deletions(-)
create mode 100644 README
Unmodified
$ git status
# On branch master
nothing to commit (working directory clean)
30 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 58: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/58.jpg)
Introducao ao git – Workflow basico
Untracked, Unmodified, Modified eStaged
$ git commit -m "README e mudancas no Hello World"
[master 2b32cb9] README e mudancas no Hello World
1 files changed, 1 insertions(+), 1 deletions(-)
create mode 100644 README
Unmodified
$ git status
# On branch master
nothing to commit (working directory clean)
30 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 59: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/59.jpg)
Introducao ao git – Workflow basico
Visualizando modificacoes
$ vim hello_world.py
$ git status
[...]
$ git diff
[...]
$ git add hello_world.py
$ git status
[...]
$ git diff --staged
[...]
31 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 60: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/60.jpg)
Introducao ao git – Workflow basico
Visualizando modificacoes
$ vim hello_world.py
$ git status
[...]
$ git diff
[...]
$ git add hello_world.py
$ git status
[...]
$ git diff --staged
[...]
31 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 61: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/61.jpg)
Introducao ao git – Workflow basico
Removendo arquivos
$ rm README
$ git status
# On branch master
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: README
#
no changes added to commit (use "git add" and/or "git commit -a")
32 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 62: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/62.jpg)
Introducao ao git – Workflow basico
Removendo arquivos
$ rm README
$ git status
# On branch master
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: README
#
no changes added to commit (use "git add" and/or "git commit -a")
32 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 63: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/63.jpg)
Introducao ao git – Workflow basico
Removendo arquivos
$ git rm README
rm ’README’
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: README
#
$ git commit -m "Removi o README"
[master b09a767] Removi o README
0 files changed, 0 insertions(+), 0 deletions(-)
delete mode 100644 README
33 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 64: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/64.jpg)
Introducao ao git – Workflow basico
Removendo arquivos
$ git rm README
rm ’README’
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: README
#
$ git commit -m "Removi o README"
[master b09a767] Removi o README
0 files changed, 0 insertions(+), 0 deletions(-)
delete mode 100644 README
33 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 65: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/65.jpg)
Introducao ao git – Workflow basico
Removendo arquivos
$ git rm README
rm ’README’
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: README
#
$ git commit -m "Removi o README"
[master b09a767] Removi o README
0 files changed, 0 insertions(+), 0 deletions(-)
delete mode 100644 README
33 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 66: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/66.jpg)
Introducao ao git – Obtendo ajuda
Obtendo ajuda
$ git help <verb>
$ git <verb> --help
$ man git-<verb>
$ git <verb> -h
$ git commit -h
usage: git commit [options] [--] <filepattern>...
-q, --quiet suppress summary after successful commit
-v, --verbose show diff in commit message template
Commit message options
-F, --file <file> read message from file
--author <author> override author for commit
--date <date> override date for commit
-m, --message <message>
commit message
-c, --reedit-message <commit>
reuse and edit message from specified commit
-C, --reuse-message <commit>
reuse message from specified commit
--fixup <commit> use autosquash formatted message to fixup specified commit
--squash <commit> use autosquash formatted message to squash specified commit
--reset-author the commit is authored by me now (used with -C-c/--amend)
-s, --signoff add Signed-off-by:
-t, --template <file>
use specified template file
-e, --edit force edit of commit
...
34 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 67: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/67.jpg)
Introducao ao git – Visualizando o historico do repositorio
git log
$ git log
commit b09a76779af9257ccd69c1fc5aac3e1dd0d03693
Author: Felipe Oliveira Carvalho <[email protected]>
Date: Sun Oct 2 22:41:32 2011 -0300
Removi o README
commit 2b32cb93b49dbd87b2387f21ee3b945b4c822fbf
Author: Felipe Oliveira Carvalho <[email protected]>
Date: Sun Oct 2 22:25:23 2011 -0300
README e mudancas no Hello World
commit e3d5175ca59febe510b1e0689040d2702b08c7ee
Author: Felipe Oliveira Carvalho <[email protected]>
Date: Sun Oct 2 17:36:41 2011 -0300
Hello World em Python
commit 9b302737d41712809ca455b1d522c334793ef001
Author: Felipe Oliveira Carvalho <[email protected]>
Date: Sun Oct 2 15:45:23 2011 -0300
Primeiro commit
35 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 68: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/68.jpg)
Introducao ao git – Visualizando o historico do repositorio
Visualizando um commit
$ git show 2b32cb93
commit 2b32cb93b49dbd87b2387f21ee3b945b4c822fbf
Author: Felipe Oliveira Carvalho <[email protected]>
Date: Sun Oct 2 22:25:23 2011 -0300
README e mudancas no Hello World
diff --git a/README b/README
new file mode 100644
index 0000000..e69de29
diff --git a/hello_world.py b/hello_world.py
index 088ea5c..ffee107 100644
--- a/hello_world.py
+++ b/hello_world.py
@@ -1 +1 @@
-print "Hell World!"
+print "Alo mundo!"
36 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 69: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/69.jpg)
Introducao ao git – Visualizando o historico do repositorio
gitk
$ gitk &
37 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 70: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/70.jpg)
1 IntroducaoO que e controle de versao?O que e git?
2 Introducao ao gitPrimeiros passosRepositoriosWorkflow basicoObtendo ajudaVisualizando o historico do repositorio
3 Branching e MergingArmazenamento de commitsBranchesDesenvolvimento nao-linearResolvendo conflitos de merge
4 git no servidorIntroducaoTrabalhando em grupo
5 Extras
38 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 71: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/71.jpg)
Branching e Merging – Armazenamento de commits
Armazenamento de commits
39 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 72: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/72.jpg)
Branching e Merging – Branches
Branches
40 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 73: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/73.jpg)
Branching e Merging – Branches
Criando um novo branch – branching
$ git branch testing
41 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 74: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/74.jpg)
Branching e Merging – Branches
Selecionando um branch
$ git checkout testing
42 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 75: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/75.jpg)
Branching e Merging – Branches
branch + checkout em um unico co-mando
$ git checkout -b testing
Switched to a new branch ’testing’
43 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 76: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/76.jpg)
Branching e Merging – Branches
Editando o novo branch
$ vim test.py
$ git add test.py
$ git commit -m "Teste"
44 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 77: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/77.jpg)
45 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 78: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/78.jpg)
Branching e Merging – Branches
Merge simples – Fast-forward
$ git checkout master
Switched to branch ’master’
$ git branch
* master
testing
$ git merge testing
Updating b09a767..cc68299
Fast-forward
test.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 test.py
46 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 79: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/79.jpg)
Branching e Merging – Branches
Merge simples – Fast-forward
$ git checkout master
Switched to branch ’master’
$ git branch
* master
testing
$ git merge testing
Updating b09a767..cc68299
Fast-forward
test.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 test.py
46 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 80: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/80.jpg)
Branching e Merging – Branches
Merge simples – Fast-forward
$ git checkout master
Switched to branch ’master’
$ git branch
* master
testing
$ git merge testing
Updating b09a767..cc68299
Fast-forward
test.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 test.py
46 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 81: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/81.jpg)
47 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 82: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/82.jpg)
Branching e Merging – Desenvolvimento nao-linear
Um exemplo
Clone o codigo que esta na producao
Crie um branch para issue #53 (‘iss53’)
Trabalhe por 10 minutos
Alguem pede um hotfix para a issue #102
checkout ‘master’
Crie o branch ‘iss102’
Resolva o problema
checkout ‘master‘, merge ‘iss102’
push para a versao publica
checkout ‘iss53’ e continue trabalhando
48 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 83: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/83.jpg)
Branching e Merging – Desenvolvimento nao-linear
Mais situacoes
Isolar unidades de trabalho
49 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 84: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/84.jpg)
Branching e Merging – Desenvolvimento nao-linear
Mais situacoes
Voce quer experimentar algumaideia
50 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 85: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/85.jpg)
Branching e Merging – Desenvolvimento nao-linear
Mais situacoes
Voce vai fazer algo que vai demorar
51 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 86: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/86.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
Resolva a issue 53. Crie um branch para isso a partir do master:
$ git checkout -b iss53
Switched to a new branch ’iss53’
Corrija o problema no codigo:
$ vim hello_world.py
52 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 87: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/87.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
Resolva a issue 53. Crie um branch para isso a partir do master:
$ git checkout -b iss53
Switched to a new branch ’iss53’
Corrija o problema no codigo:
$ vim hello_world.py
52 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 88: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/88.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
Resolva a issue 53. Crie um branch para isso a partir do master:
$ git checkout -b iss53
Switched to a new branch ’iss53’
Corrija o problema no codigo:
$ vim hello_world.py
52 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 89: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/89.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
Resolva a issue 53. Crie um branch para isso a partir do master:
$ git checkout -b iss53
Switched to a new branch ’iss53’
Corrija o problema no codigo:
$ vim hello_world.py
52 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 90: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/90.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
$ git diff
diff --git a/hello_world.py b/hello_world.py
index ffee107..349aa41 100644
--- a/hello_world.py
+++ b/hello_world.py
@@ -1 +1 @@
-print "Alo mundo!"
+print "Alo, mundo!"
53 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 91: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/91.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
commit das mudancas feitas:
$ git commit -a -m "Vırgula adicionada [iss53]"
[iss53 63f9671] Vırgula adicionada [iss53]
1 files changed, 1 insertions(+), 1 deletions(-)
54 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 92: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/92.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
commit das mudancas feitas:
$ git commit -a -m "Vırgula adicionada [iss53]"
[iss53 63f9671] Vırgula adicionada [iss53]
1 files changed, 1 insertions(+), 1 deletions(-)
54 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 93: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/93.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
Uma feature tem que ser implementada agora! Faca checkout domaster, pois a nova feature vai ser implementada a partir do
codigo estavel: supostamente o codigo no branch master.
$ git checkout master
Switched to branch ’master’
Crie um novo branch – bomdia – para implementar a nova feature:
$ git checkout -b bomdia
Switched to a new branch ’bomdia’
$ vim bom_dia.py
55 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 94: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/94.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
Uma feature tem que ser implementada agora! Faca checkout domaster, pois a nova feature vai ser implementada a partir do
codigo estavel: supostamente o codigo no branch master.
$ git checkout master
Switched to branch ’master’
Crie um novo branch – bomdia – para implementar a nova feature:
$ git checkout -b bomdia
Switched to a new branch ’bomdia’
$ vim bom_dia.py
55 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 95: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/95.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
Uma feature tem que ser implementada agora! Faca checkout domaster, pois a nova feature vai ser implementada a partir do
codigo estavel: supostamente o codigo no branch master.
$ git checkout master
Switched to branch ’master’
Crie um novo branch – bomdia – para implementar a nova feature:
$ git checkout -b bomdia
Switched to a new branch ’bomdia’
$ vim bom_dia.py
55 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 96: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/96.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
$ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# bom_dia.py
nothing added to commit but untracked files present (use "git add" to track)
$ git add bom_dia.py
56 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 97: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/97.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
$ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# bom_dia.py
nothing added to commit but untracked files present (use "git add" to track)
$ git add bom_dia.py
56 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 98: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/98.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
$ git diff --staged
diff --git a/bom_dia.py b/bom_dia.py
new file mode 100644
index 0000000..b62bb76
--- /dev/null
+++ b/bom_dia.py
@@ -0,0 +1 @@
+print "Bom dia!"
57 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 99: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/99.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
commit do ”bom dia”:
$ git commit -a # use o editor para inserir a mensagem
[master cf9146f] Nova feature: script que diz "bom dia"
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 bom_dia.py
58 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 100: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/100.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
commit do ”bom dia”:
$ git commit -a # use o editor para inserir a mensagem
[master cf9146f] Nova feature: script que diz "bom dia"
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 bom_dia.py
58 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 101: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/101.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
commit do ”bom dia”:
$ git commit -a # use o editor para inserir a mensagem
[master cf9146f] Nova feature: script que diz "bom dia"
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 bom_dia.py
58 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 102: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/102.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
Adicionando mudancas ao branch branch master.
$ git checkout master
$ git merge bomdia
Updating cc68299..296d018
Fast-forward
bom_dia.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 bom_dia.py
59 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 103: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/103.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
Adicionando mudancas ao branch branch master.
$ git checkout master
$ git merge bomdia
Updating cc68299..296d018
Fast-forward
bom_dia.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 bom_dia.py
59 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 104: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/104.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
60 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 105: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/105.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
O merge ja foi feito, entao voce pode deletar o branch bomdia.master contem o codigo com a feature que foi solicitada. Entao
esse codigo pode ser enviado para a producao (ou nao).
$ git branch -d bomdia
Deleted branch bomdia (was 296d018).
E agora voce pode continuar a trabalhar na resulucao da issue #53.
$ git checkout iss53
Switched to branch ’iss53’
61 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 106: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/106.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
O merge ja foi feito, entao voce pode deletar o branch bomdia.master contem o codigo com a feature que foi solicitada. Entao
esse codigo pode ser enviado para a producao (ou nao).
$ git branch -d bomdia
Deleted branch bomdia (was 296d018).
E agora voce pode continuar a trabalhar na resulucao da issue #53.
$ git checkout iss53
Switched to branch ’iss53’
61 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 107: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/107.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
O merge ja foi feito, entao voce pode deletar o branch bomdia.master contem o codigo com a feature que foi solicitada. Entao
esse codigo pode ser enviado para a producao (ou nao).
$ git branch -d bomdia
Deleted branch bomdia (was 296d018).
E agora voce pode continuar a trabalhar na resulucao da issue #53.
$ git checkout iss53
Switched to branch ’iss53’
61 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 108: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/108.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
O merge ja foi feito, entao voce pode deletar o branch bomdia.master contem o codigo com a feature que foi solicitada. Entao
esse codigo pode ser enviado para a producao (ou nao).
$ git branch -d bomdia
Deleted branch bomdia (was 296d018).
E agora voce pode continuar a trabalhar na resulucao da issue #53.
$ git checkout iss53
Switched to branch ’iss53’
61 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 109: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/109.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
$ vim hello_world.py
$ git commit -a -m "mundo => Mundo"
[iss53 e4c9096] mundo => Mundo
1 files changed, 1 insertions(+), 1 deletions(-)
62 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 110: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/110.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
$ vim hello_world.py
$ git commit -a -m "mundo => Mundo"
[iss53 e4c9096] mundo => Mundo
1 files changed, 1 insertions(+), 1 deletions(-)
62 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 111: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/111.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
$ vim hello_world.py
$ git commit -a -m "mundo => Mundo"
[iss53 e4c9096] mundo => Mundo
1 files changed, 1 insertions(+), 1 deletions(-)
62 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 112: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/112.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
merge iss53 com o master.
$ git checkout master
Switched to branch ’master’
$ git merge iss53
Merge made by recursive.
hello_world.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
63 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 113: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/113.jpg)
Branching e Merging – Desenvolvimento nao-linear
Passo-a-passo do exemplo
64 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 114: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/114.jpg)
65 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 115: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/115.jpg)
$ git merge umbranch
Auto-merging hello_world.py
CONFLICT (content): Merge conflict in hello_world.py
Automatic merge failed; fix conflicts and then commit the result.
$ cat hello_world.py
<<<<<<< HEAD
print "Alo, Mundo!" # Imprime Alo, Mundo
=======
print "Alo, Mundo!" # LOL
>>>>>>> umbranch
66 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 116: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/116.jpg)
$ git merge umbranch
Auto-merging hello_world.py
CONFLICT (content): Merge conflict in hello_world.py
Automatic merge failed; fix conflicts and then commit the result.
$ cat hello_world.py
<<<<<<< HEAD
print "Alo, Mundo!" # Imprime Alo, Mundo
=======
print "Alo, Mundo!" # LOL
>>>>>>> umbranch
66 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 117: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/117.jpg)
1 IntroducaoO que e controle de versao?O que e git?
2 Introducao ao gitPrimeiros passosRepositoriosWorkflow basicoObtendo ajudaVisualizando o historico do repositorio
3 Branching e MergingArmazenamento de commitsBranchesDesenvolvimento nao-linearResolvendo conflitos de merge
4 git no servidorIntroducaoTrabalhando em grupo
5 Extras
67 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 118: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/118.jpg)
git no servidor – Introducao
Criando um projeto no servidor
$ git clone --bare my_project my_project.git
Initialized empty Git repository in /opt/projects/my_project.git/
$ scp -r my_project.git [email protected]:/opt/git
Outro usuario clona o repositorio
$ git clone [email protected]:/opt/git/my_project.git
$ ssh [email protected]
$ cd /opt/git/my_project.git
$ git init --bare --shared
68 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 119: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/119.jpg)
git no servidor – Introducao
Criando um projeto no servidor
$ git clone --bare my_project my_project.git
Initialized empty Git repository in /opt/projects/my_project.git/
$ scp -r my_project.git [email protected]:/opt/git
Outro usuario clona o repositorio
$ git clone [email protected]:/opt/git/my_project.git
$ ssh [email protected]
$ cd /opt/git/my_project.git
$ git init --bare --shared
68 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 120: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/120.jpg)
git no servidor – Introducao
Criando um projeto no servidor
$ git clone --bare my_project my_project.git
Initialized empty Git repository in /opt/projects/my_project.git/
$ scp -r my_project.git [email protected]:/opt/git
Outro usuario clona o repositorio
$ git clone [email protected]:/opt/git/my_project.git
$ ssh [email protected]
$ cd /opt/git/my_project.git
$ git init --bare --shared
68 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 121: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/121.jpg)
git no servidor – Introducao
Criando um projeto no servidor
$ git clone --bare my_project my_project.git
Initialized empty Git repository in /opt/projects/my_project.git/
$ scp -r my_project.git [email protected]:/opt/git
Outro usuario clona o repositorio
$ git clone [email protected]:/opt/git/my_project.git
$ ssh [email protected]
$ cd /opt/git/my_project.git
$ git init --bare --shared
68 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 122: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/122.jpg)
Outros usuarios podem enviar as mudancas para o repositorio noservidor.
$ vim README
$ git commit -am ’fix for the README file’
$ git push origin master
69 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 123: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/123.jpg)
git no servidor – Introducao
github
http://github.com
70 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 124: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/124.jpg)
git no servidor – Trabalhando em grupo
Workflow basico
Usuario clona o repositorio remoto com git clone e trabalhalocalmente.
$ vim TODO
$ git commit -a
Usuario quer enviar suas mudancas para o servidor:
$ git fetch origin
$ git merge origin/master
$ git push
71 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 125: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/125.jpg)
git no servidor – Trabalhando em grupo
Workflow basico
Usuario clona o repositorio remoto com git clone e trabalhalocalmente.
$ vim TODO
$ git commit -a
Usuario quer enviar suas mudancas para o servidor:
$ git fetch origin
$ git merge origin/master
$ git push
71 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 126: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/126.jpg)
git no servidor – Trabalhando em grupo
Workflow basico
Usuario clona o repositorio remoto com git clone e trabalhalocalmente.
$ vim TODO
$ git commit -a
Usuario quer enviar suas mudancas para o servidor:
$ git fetch origin
$ git merge origin/master
$ git push
71 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 127: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/127.jpg)
git no servidor – Trabalhando em grupo
git pull
git pull = fetch + merge
72 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 128: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/128.jpg)
Extras
Comandos uteis
git blame
git grep
git cherry-pick
git stash
73 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 129: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/129.jpg)
Extras
Comandos uteis
git blame
git grep
git cherry-pick
git stash
73 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 130: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/130.jpg)
Extras
Comandos uteis
git blame
git grep
git cherry-pick
git stash
73 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 131: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/131.jpg)
Extras
Comandos uteis
git blame
git grep
git cherry-pick
git stash
73 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 132: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/132.jpg)
git stash
save
list
drop
pop
apply
74 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 133: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/133.jpg)
git stash
save
list
drop
pop
apply
74 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 134: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/134.jpg)
git stash
save
list
drop
pop
apply
74 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 135: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/135.jpg)
git stash
save
list
drop
pop
apply
74 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 136: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/136.jpg)
git stash
save
list
drop
pop
apply
74 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 137: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/137.jpg)
Extras
Pro Git
http://progit.org
75 / 76 Felipe Oliveira Carvalho Controle de Versao com git
![Page 138: Mini-curso de git -- SECOMP-UFS](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55615521d8b42a8a7d8b52de/html5/thumbnails/138.jpg)
Mais perguntas
Mais perguntas?
Mais perguntas?
76 / 76 Felipe Oliveira Carvalho Controle de Versao com git