Skip to content
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

Merged
merged 3 commits into from
Oct 27, 2016
Merged

git-reset: expand page #1127

merged 3 commits into from
Oct 27, 2016

Conversation

waldyrious
Copy link
Member

As mentioned in #1088 (comment)

@mention-bot
Copy link

@waldyrious, thanks for your PR! By analyzing the history of the files in this pull request, we identified @eliotsykes to be a potential reviewer.

@waldyrious waldyrious added the page edit Changes to an existing page(s). label Oct 24, 2016
@waldyrious
Copy link
Member Author

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`
Copy link
Contributor

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!

Copy link
Member Author

@waldyrious waldyrious Oct 25, 2016

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 :)

Copy link
Member Author

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...)

Copy link
Contributor

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

Copy link
Contributor

@leostera leostera Oct 25, 2016

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 :)

@agnivade
Copy link
Member

👍

@waldyrious
Copy link
Member Author

@Ostera so what's your verdict? :)

@leostera
Copy link
Contributor

LGTM!

@waldyrious waldyrious merged commit 05c6393 into master Oct 27, 2016
@waldyrious waldyrious deleted the git-reset branch October 27, 2016 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
page edit Changes to an existing page(s).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants