Thread (36 messages) flat view 36 messages, 11 authors, 2016-06-15

Re: EasyGit Integration

From: Björn Steinbrink <hidden>
Date: 2016-06-15 22:46:56

On 2009.06.13 01:30:38 +0300, Felipe Contreras wrote:
On Sat, Jun 13, 2009 at 1:05 AM, Jakub Narebski[off-list ref] wrote:
quoted
On Fri, 12 Jun 2009, Felipe Contreras wrote:
quoted
On Sat, Jun 13, 2009 at 12:21 AM, Jakub Narebski[off-list ref] wrote:
quoted
quoted
Nope. 'git reset' always reset some part of state to a given commit,
HEAD by default.  It can reset current branch with --soft, branch plus
index with --mixed (default), and branch plus index plus working
directory with --hard.  Source is always commit.
You said it: 'git reset --hard' gets something out of the repository
and into the working directory.

Try this:
git checkout <random sha-1 with no ref>

Then what is the difference between:
git checkout HEAD^
git reset --hard HEAD^

In this case they do exactly the same thing, don't they?
No, they don't.  "git checkout HEAD^" modifies HEAD detaching it.
"git reset --hard HEAD^" modifies branch that HEAD points to (well,
unless HEAD is detached).
Read again:
quoted
quoted
git checkout <random sha-1 with no ref>
The HEAD is detached, so they do exactly the same in this case.
Not if there are uncommitted changes to tracked files.

Björn
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help