开发者

What does 'git reset' command do without any option?

开发者 https://www.devze.com 2023-03-25 20:38 出处:网络
What does \'git reset\' command will do without any 开发者_StackOverflowother option? Will it reset the staging index with the head?Exactly.

What does 'git reset' command will do without any 开发者_StackOverflowother option? Will it reset the staging index with the head?


Exactly.

Without option, "git reset" is interpreted as "git reset --mixed HEAD".

git reset has three modes: soft, mixed, and hard (the default is "mixed").

Like many other git commands, git reset takes an argument which is a reference to a commit (a branch name, a tag name, a commit SHA, a relative reference like HEAD~2). By default, if no reference is specified, HEAD is used.

I suggest you read the last blog entry of "Progit", which explains in detail the "git reset" command: http://git-scm.com/book/en/v2/Git-Tools-Reset-Demystified


Have a look at my answers here: "git rm --cached x" vs "git reset head -- x"?

here: What's the difference between git reset file and git checkout file?

and here: Why are there 2 ways to unstage a file in git?

And use the search as well.

0

精彩评论

暂无评论...
验证码 换一张
取 消