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

« back to all changes in this revision

Viewing changes to Documentation/git-reset.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:
63
63
<1> This is most often done when you remembered what you
64
64
just committed is incomplete, or you misspelled your commit
65
65
message, or both.  Leaves working tree as it was before "reset".
66
 
<2> make corrections to working tree files.
 
66
<2> Make corrections to working tree files.
67
67
<3> "reset" copies the old head to .git/ORIG_HEAD; redo the
68
68
commit by starting with its log message.  If you do not need to
69
69
edit the message further, you can give -C option instead.
106
106
$ git pull git://info.example.com/ nitfol  <4>
107
107
------------
108
108
+
109
 
<1> you are happily working on something, and find the changes
 
109
<1> You are happily working on something, and find the changes
110
110
in these files are in good order.  You do not want to see them
111
111
when you run "git diff", because you plan to work on other files
112
112
and changes with these files are distracting.
113
 
<2> somebody asks you to pull, and the changes sounds worthy of merging.
114
 
<3> however, you already dirtied the index (i.e. your index does
 
113
<2> Somebody asks you to pull, and the changes sounds worthy of merging.
 
114
<3> However, you already dirtied the index (i.e. your index does
115
115
not match the HEAD commit).  But you know the pull you are going
116
116
to make does not affect frotz.c nor filfre.c, so you revert the
117
117
index changes for these two files.  Your changes in working tree
118
118
remain there.
119
 
<4> then you can pull and merge, leaving frotz.c and filfre.c
 
119
<4> Then you can pull and merge, leaving frotz.c and filfre.c
120
120
changes still in the working tree.
121
121
 
122
122
Undo a merge or pull::
133
133
$ git reset --hard ORIG_HEAD       <4>
134
134
------------
135
135
+
136
 
<1> try to update from the upstream resulted in a lot of
 
136
<1> Try to update from the upstream resulted in a lot of
137
137
conflicts; you were not ready to spend a lot of time merging
138
138
right now, so you decide to do that later.
139
139
<2> "pull" has not made merge commit, so "git reset --hard"
140
140
which is a synonym for "git reset --hard HEAD" clears the mess
141
141
from the index file and the working tree.
142
 
<3> merge a topic branch into the current branch, which resulted
 
142
<3> Merge a topic branch into the current branch, which resulted
143
143
in a fast forward.
144
 
<4> but you decided that the topic branch is not ready for public
 
144
<4> But you decided that the topic branch is not ready for public
145
145
consumption yet.  "pull" or "merge" always leaves the original
146
146
tip of the current branch in ORIG_HEAD, so resetting hard to it
147
147
brings your index file and the working tree back to that state,