~ubuntu-branches/ubuntu/intrepid/git-core/intrepid-security

« back to all changes in this revision

Viewing changes to Documentation/howto/rebase-and-edit.txt

  • Committer: Package Import Robot
  • Author(s): Gerrit Pape
  • Date: 2007-10-04 08:27:01 UTC
  • mfrom: (1.1.23)
  • Revision ID: package-import@ubuntu.com-20071004082701-rsd058ontoqz4i30
Tags: 1:1.5.3.4-1
new upstream point release (closes: #445188).

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
On Sat, 13 Aug 2005, Linus Torvalds wrote:
11
11
 
12
 
> That's correct. Same things apply: you can move a patch over, and create a 
13
 
> new one with a modified comment, but basically the _old_ commit will be 
 
12
> That's correct. Same things apply: you can move a patch over, and create a
 
13
> new one with a modified comment, but basically the _old_ commit will be
14
14
> immutable.
15
15
 
16
16
Let me clarify.
17
17
 
18
18
You can entirely _drop_ old branches, so commits may be immutable, but
19
 
nothing forces you to keep them. Of course, when you drop a commit, you'll 
20
 
always end up dropping all the commits that depended on it, and if you 
21
 
actually got somebody else to pull that commit you can't drop it from 
 
19
nothing forces you to keep them. Of course, when you drop a commit, you'll
 
20
always end up dropping all the commits that depended on it, and if you
 
21
actually got somebody else to pull that commit you can't drop it from
22
22
_their_ repository, but undoing things is not impossible.
23
23
 
24
24
For example, let's say that you've made a mess of things: you've committed
29
29
        # for reference
30
30
        git branch broken
31
31
 
32
 
        # Reset the main branch to three parents back: this 
 
32
        # Reset the main branch to three parents back: this
33
33
        # effectively undoes the three top commits
34
34
        git reset HEAD^^^
35
35
        git checkout -f
59
59
 
60
60
to see that everything looks sensible.
61
61
 
62
 
And then, you can just remove the broken branch if you decide you really 
 
62
And then, you can just remove the broken branch if you decide you really
63
63
don't want it:
64
64
 
65
65
        # remove 'broken' branch
68
68
        # Prune old objects if you're really really sure
69
69
        git prune
70
70
 
71
 
And yeah, I'm sure there are other ways of doing this. And as usual, the 
72
 
above is totally untested, and I just wrote it down in this email, so if 
 
71
And yeah, I'm sure there are other ways of doing this. And as usual, the
 
72
above is totally untested, and I just wrote it down in this email, so if
73
73
I've done something wrong, you'll have to figure it out on your own ;)
74
74
 
75
75
                        Linus
77
77
To unsubscribe from this list: send the line "unsubscribe git" in
78
78
the body of a message to majordomo@vger.kernel.org
79
79
More majordomo info at  http://vger.kernel.org/majordomo-info.html
80
 
 
81