-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git-reset: expand page #1127
git-reset: expand page #1127
Conversation
As mentioned in #1088 (comment)
@waldyrious, thanks for your PR! By analyzing the history of the files in this pull request, we identified @eliotsykes to be a potential reviewer. |
Also requesting review by @sethwoodworth, who has contributed to several git subcommand pages. |
|
||
- Undo the last two commits, adding their changes to the index, i.e. staged for commit: | ||
|
||
`git reset --soft HEAD~2` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one (but with HEAD^1
I have aliased as git unstage
-- useful stuff!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After reading http://www.paulboxley.com/blog/2011/06/git-caret-and-tilde I stopped using ^ unless I'm talking about merge commits. The analogy I used was that ~1
means "parent", ~2
means "grandparent", and so on; and that ^1
means "father", and ^2
means "mother". The visual bifurcation of the ^
symbol helps me remember this :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, that's not git unstage, that's git uncommit -- see the second line of the main description. (I find it incredible that someone thought it was a good idea to cram these two different behaviors into the same command...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting! I ended up calling it unstage because I want to remove a file from the staging area, so I can commit a subset of what was added – maybe I added more or other files than I wanted.
I'll have to revisit my .gitconfig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, you're right. I wasn't using HEAD^1
, just HEAD
:)
👍 |
@Ostera so what's your verdict? :) |
LGTM! |
As mentioned in #1088 (comment)