1
0
mirror of https://github.com/k88hudson/git-flight-rules.git synced 2025-03-10 12:48:43 -03:00

Add section on reset -p to unstage edits

Expanded  explanation & corrected bad grammar.
This commit is contained in:
nielsonm 2018-10-31 17:33:19 -07:00 committed by Richard Littauer
parent b67b184d8a
commit 5cfcca513c

View File

@ -44,6 +44,7 @@ All commands should work for at least git version 2.13.0. See the [git website](
- [I need to add staged changes to the previous commit](#i-need-to-add-staged-changes-to-the-previous-commit) - [I need to add staged changes to the previous commit](#i-need-to-add-staged-changes-to-the-previous-commit)
- [I want to stage part of a new file, but not the whole file](#i-want-to-stage-part-of-a-new-file-but-not-the-whole-file) - [I want to stage part of a new file, but not the whole file](#i-want-to-stage-part-of-a-new-file-but-not-the-whole-file)
- [I want to add changes in one file to two different commits](#i-want-to-add-changes-in-one-file-to-two-different-commits) - [I want to add changes in one file to two different commits](#i-want-to-add-changes-in-one-file-to-two-different-commits)
- [I staged too many edits, and I want to break them out into a separate commit](#i-staged-too-many-edits-and-i-want-to-break-them-out-into-a-separate-commit)
- [I want to stage my unstaged edits, and unstage my staged edits](#i-want-to-stage-my-unstaged-edits-and-unstage-my-staged-edits) - [I want to stage my unstaged edits, and unstage my staged edits](#i-want-to-stage-my-unstaged-edits-and-unstage-my-staged-edits)
- [Unstaged Edits](#unstaged-edits) - [Unstaged Edits](#unstaged-edits)
- [I want to move my unstaged edits to a new branch](#i-want-to-move-my-unstaged-edits-to-a-new-branch) - [I want to move my unstaged edits to a new branch](#i-want-to-move-my-unstaged-edits-to-a-new-branch)
@ -442,6 +443,11 @@ Then, you will need to use the `e` option to manually choose which lines to add.
`git add` will add the entire file to a commit. `git add -p` will allow to interactively select which changes you want to add. `git add` will add the entire file to a commit. `git add -p` will allow to interactively select which changes you want to add.
<a href="selective-unstage-edits"></a>
### I staged too many edits, and I want to break them out into a separate commit
`git reset -p` will open a patch mode reset dialog. Much like `git add -p` but selecting yes will unstage the change, removing it from the upcoming commit.
<a href="unstaging-edits-and-staging-the-unstaged"></a> <a href="unstaging-edits-and-staging-the-unstaged"></a>
### I want to stage my unstaged edits, and unstage my staged edits ### I want to stage my unstaged edits, and unstage my staged edits