Skip to content

Commit beea444

Browse files
djalmaoliveiraschacon
authored andcommitted
13_, 14_ done
Signed-off-by: Scott Chacon <schacon@gmail.com>
1 parent c26d066 commit beea444

File tree

2 files changed

+80
-77
lines changed

2 files changed

+80
-77
lines changed

text/13_Rebasing/0_ Rebasing.markdown

100644100755
Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,69 @@
1-
## Rebasing ##
1+
## Rebasing ##
22

3-
Suppose that you create a branch "mywork" on a remote-tracking branch
4-
"origin".
3+
Suponha que você criou um branch "mywork" sobre um branch remoto "origin".
54

65
$ git checkout -b mywork origin
76

87
[fig:rebase0]
98

10-
Now you do some work, creating two new commits.
9+
Agora você faz algum trabalho, criando dois novos commits.
1110

1211
$ vi file.txt
1312
$ git commit
1413
$ vi otherfile.txt
1514
$ git commit
1615
...
17-
18-
Meanwhile, someone else does some work creating two new commits on the origin
19-
branch too. This means both 'origin' and 'mywork' has advanced, which means
20-
the work has diverged.
16+
17+
Enquanto isso, alguém também faz algum trabalho criando dois novos commits
18+
sobre o branch origin.
19+
Nisso ambos 'origin' e 'mywork' avançam seus trabalhos, existindo divergências
20+
entre eles.
2121

2222
[fig:rebase1]
2323

24-
At this point, you could use "pull" to merge your changes back in;
25-
the result would create a new merge commit, like this:
24+
Neste ponto, você poderia usar "pull" para juntar suas alterações de volta
25+
nele; o resultado criará um novo commit através do merge, como isso:
2626

2727
[fig:rebase2]
2828

29-
However, if you prefer to keep the history in mywork a simple series of
30-
commits without any merges, you may instead choose to use
29+
Contudo se você prefere manter o histórico em 'mywork', como uma simples série
30+
de commits sem qualquer merge, ao invés disso você pode escolher usar
3131
linkgit:git-rebase[1]:
3232

3333
$ git checkout mywork
3434
$ git rebase origin
3535

36-
This will remove each of your commits from mywork, temporarily saving
37-
them as patches (in a directory named ".git/rebase"), update mywork to
38-
point at the latest version of origin, then apply each of the saved
39-
patches to the new mywork.
36+
Isso removerá cada um dos seus commits de 'mywork', temporariamente salvando
37+
eles como patches (em um diretório chamado ".git/rebase"), atualizar 'mywork' para
38+
apontar para a última versão de 'origin', então aplicar cada um dos patches salvos
39+
para o novo 'mywork'.
4040

4141
[fig:rebase3]
4242

43-
Once the ref ('mywork') is updated to point to the newly created commit
44-
objects, your older commits will be abandoned. They will likely be
45-
removed if you run a pruning garbage collection. (see linkgit:git-gc[1])
43+
Uma vez que ('mywork') é atualizado para apontar para o mais novo objeto commit
44+
criado, seus velhos commits serão abandonados. Eles provavelmente serão
45+
removidos se você executar a coleta de lixo. (see linkgit:git-gc[1])
4646

4747
[fig:rebase4]
4848

49-
So now we can look at the difference in our history between running a merge
50-
and running a rebase:
49+
Então agora podemos ver a diferença em nosso histórico entre um merge e um
50+
rebase executado:
5151

5252
[fig:rebase5]
5353

54-
In the process of the rebase, it may discover conflicts. In that case it will stop
55-
and allow you to fix the conflicts; after fixing conflicts, use "git-add"
56-
to update the index with those contents, and then, instead of
57-
running git-commit, just run
54+
No processo de rebase, ele pode descobrir alguns conflitos. Nesse caso ele
55+
interromperá e permitirá a você corrigir os conflitos; depois que corrigí-los,
56+
use "git-add" para atualizar o index com esse conteúdo, e então, ao invés de
57+
executar git-commit, só execute
5858

5959
$ git rebase --continue
6060

61-
and git will continue applying the rest of the patches.
61+
e o git continuará aplicando o resto dos patches.
6262

63-
At any point you may use the `--abort` option to abort this process and
64-
return mywork to the state it had before you started the rebase:
63+
Em qualquer ponto você pode usar a opção '--abort' para esse processo e
64+
retornar 'mywork' para o estado que tinha antes de você iniciar o rebase:
6565

6666
$ git rebase --abort
6767

6868

69-
[gitcast:c7-rebase]("GitCast #7: Rebasing")
69+
[gitcast:c7-rebase]("GitCast #7: Rebasing")
Lines changed: 51 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
1-
## Interactive Rebasing ##
1+
## Rebasing Interativo ##
22

3-
You can also rebase interactively. This is often used to re-write your
4-
own commit objects before pusing them somewhere. It is an easy way to
5-
split, merge or re-order commits before sharing them with others. You
6-
can also use it to clean up commits you've pulled from someone when
7-
applying them locally.
3+
Você pode também realizar um rebase interativamente. Isso é usado muitas vezes
4+
para re-escrever seus próprios objetos commit antes de enviá-los para algum
5+
lugar. Isso é uma forma fácil de dividir, juntar, ou re-ordenar os commits
6+
antes de compartilhá-los com os outros. Você pode também usá-lo para limpar
7+
commits que você tenha baixado de alguém quando estiver aplicando ele
8+
localmente.
89

9-
If you have a number of commits that you would like to somehow modify
10-
during the rebase, you can invoke interactive mode by passing a '-i' or
11-
'--interactive' to the 'git rebase' command.
10+
Se você tem um número de commits que você gostaria de alguma maneira modificar
11+
durante o rebase, você pode invocar o modo interativo passando um '-i' ou
12+
'--interactive' para o comando 'git rebase'.
1213

1314
$ git rebase -i origin/master
14-
15-
This will invoke interactive rebase mode on all the commits you have made
16-
since the last time you have pushed (or merged from the origin repository).
1715

18-
To see what commits those are beforehand, you can run log this way:
19-
20-
$ git log github/master..
16+
Isso invocará o modo de rebase interativo sobre todos os commits que você tem
17+
feito desde a última vez que você realizou um pull (ou merge de um repositório
18+
origin).
19+
20+
Para ver de antemão quais são os commits, você pode executar dessa forma:
2121

22-
Once you run the 'rebase -i' command, you will be thrown into your editor
23-
of choice with something that looks like this:
22+
$ git log origin/master..
23+
24+
Uma vez que você rodar o comando 'rebase -i', você será levado para o seu
25+
editor com algo parecido com isso:
2426

2527
pick fc62e55 added file_size
2628
pick 9824bf4 fixed little thing
@@ -39,32 +41,32 @@ of choice with something that looks like this:
3941
# However, if you remove everything, the rebase will be aborted.
4042
#
4143

42-
This means that there are 5 commits since you last pushed and it gives you
43-
one line per commit with the following format:
44+
Isso significa que existem 5 commits desde o último push realizado e lhe dará
45+
uma linha por commit com o seguinte formato:
4446

4547
(action) (partial-sha) (short commit message)
46-
47-
Now, you can change the action (which is by default 'pick') to either 'edit'
48-
or 'squash', or just leave it as 'pick'. You can also reorder the commits
49-
just by moving the lines around however you want. Then, when you exit the
50-
editor, git will try to apply the commits however they are now arranged and
51-
do the action specified.
5248

53-
If 'pick' is specified, it will simply try to apply the patch and save the
54-
commit with the same message as before.
49+
Agora, você pode alterar a ação (que é por padrão 'pick') para qualquer um
50+
'edit' ou 'squash', ou deixá-lo como 'pick'. Você também pode re-ordenar os
51+
commits movendo as linhas como você quiser. Então, quando você sair do editor,
52+
o git tentará aplicar os commits como eles estão organizados agora e realizar a
53+
ação especificada.
54+
55+
Se 'pick' é especificado, ele simplesmente tentará aplicar o patch e salvar o
56+
commit com a mesma mensagem de antes.
5557

56-
If 'squash' is specified, it will combine that commit with the previous one
57-
to create a new commit. This will drop you into your editor again to merge
58-
the commit messages of the two commits it is now squashing together. So,
59-
if you exit the editor with this:
58+
Se 'squash' é especificado, ele combinará aquele commit com um anterior para
59+
criar um novo commit. Você cairá novamente em seu editor para juntar as
60+
mensagens de commit dos dois commits que agora são combinados. Então, se você
61+
sair do editor com isso:
6062

6163
pick fc62e55 added file_size
6264
squash 9824bf4 fixed little thing
6365
squash 21d80a5 added number to log
6466
squash 76b9da6 added the apply command
6567
squash c264051 Revert "added file_size" - not implemented correctly
6668

67-
Then you will have to create a single commit message from this:
69+
Então você terá que criar uma única mensagem de commit dele:
6870

6971
# This is a combination of 5 commits.
7072
# The first commit's message is:
@@ -88,36 +90,37 @@ Then you will have to create a single commit message from this:
8890

8991
This reverts commit fc62e5543b195f18391886b9f663d5a7eca38e84.
9092

91-
Once you have edited that down into once commit message and exit the editor,
92-
the commit will be saved with your new message.
93+
Uma vez que você tem editado a mensagem de commit e sair do editor,
94+
o commit será salvo com a sua nova mensagem.
9395

94-
If 'edit' is specified, it will do the same thing, but then pause before
95-
moving on to the next one and drop you into the command line so you can
96-
amend the commit, or change the commit contents somehow.
96+
Se 'edit' é especificado, fará a mesma coisa, mas desde então para antes
97+
de mover para o próximo commit e o levará para a linha de comando para você
98+
poder corrigir o commit, ou modificar o conteúdo do commit de alguma forma.
9799

98-
If you wanted to split a commit, for instance, you would specify 'edit' for
99-
that commit:
100+
Se você queria dividir um commit, por exemplo, você especificaria 'edit' para
101+
esse commit:
100102

101103
pick fc62e55 added file_size
102104
pick 9824bf4 fixed little thing
103105
edit 21d80a5 added number to log
104106
pick 76b9da6 added the apply command
105107
pick c264051 Revert "added file_size" - not implemented correctly
106108

107-
And then when you get to the command line, you revert that commit and create
108-
two (or more) new ones. Lets say 21d80a5 modified two files, file1 and file2,
109-
and you wanted to split them into seperate commits. You could do this after
110-
the rebase dropped you to the command line :
109+
E então quando você for levado para a linha de comando, você reverterá aquele
110+
commit em dois (ou mais) novos. Digamos que o 21d80a5 modificou dois arquivos,
111+
arquivo1 e arquivo2, e você queria dividir eles em commits separados. Você
112+
poderia fazer isso depois que o rebase deixá-lo na linha de comando:
111113

112114
$ git reset HEAD^
113115
$ git add file1
114116
$ git commit 'first part of split commit'
115117
$ git add file2
116118
$ git commit 'second part of split commit'
117119
$ git rebase --continue
118-
119-
And now instead of 5 commits, you would have 6.
120120

121-
The last useful thing that interactive rebase can do is drop commits for you.
122-
If instead of choosing 'pick', 'squash' or 'edit' for the commit line, you
123-
simply remove the line, it will remove the commit from the history.
121+
E agora ao invés dos 5 commits, você terá 6.
122+
123+
A última coisa útil que o modo interativo do rebase pode fazer é retirar
124+
commits para você. Se ao invés de escolher 'pick', 'squash' ou 'edit' para a
125+
linha do commit, você simplesmente remove a linha e isso removerá o commit do
126+
histórico.

0 commit comments

Comments
 (0)