1
- ## Interactive Rebasing ##
1
+ ## Rebasing Interativo ##
2
2
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.
8
9
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'.
12
13
13
14
$ 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).
17
15
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:
21
21
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:
24
26
25
27
pick fc62e55 added file_size
26
28
pick 9824bf4 fixed little thing
@@ -39,32 +41,32 @@ of choice with something that looks like this:
39
41
# However, if you remove everything, the rebase will be aborted.
40
42
#
41
43
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 :
44
46
45
47
(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.
52
48
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.
55
57
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 :
60
62
61
63
pick fc62e55 added file_size
62
64
squash 9824bf4 fixed little thing
63
65
squash 21d80a5 added number to log
64
66
squash 76b9da6 added the apply command
65
67
squash c264051 Revert "added file_size" - not implemented correctly
66
68
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 :
68
70
69
71
# This is a combination of 5 commits.
70
72
# The first commit's message is:
@@ -88,36 +90,37 @@ Then you will have to create a single commit message from this:
88
90
89
91
This reverts commit fc62e5543b195f18391886b9f663d5a7eca38e84.
90
92
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.
93
95
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 .
97
99
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:
100
102
101
103
pick fc62e55 added file_size
102
104
pick 9824bf4 fixed little thing
103
105
edit 21d80a5 added number to log
104
106
pick 76b9da6 added the apply command
105
107
pick c264051 Revert "added file_size" - not implemented correctly
106
108
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 :
111
113
112
114
$ git reset HEAD^
113
115
$ git add file1
114
116
$ git commit 'first part of split commit'
115
117
$ git add file2
116
118
$ git commit 'second part of split commit'
117
119
$ git rebase --continue
118
-
119
- And now instead of 5 commits, you would have 6.
120
120
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