You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
interactive staging: minor rewording, semantic cleanup
Reword some phrases, and emphasize the single-letter command
for each interactive staging subcommand rather than the
corresponding number.
Signed-off-by: Robert P. J. Day <[email protected]>
Copy file name to clipboardExpand all lines: book/07-git-tools/sections/interactive-staging.asc
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
[[_interactive_staging]]
2
2
=== Interactive Staging
3
3
4
-
In this section, you’ll look at a few interactive Git commands that can help you easily craft your commits to include only certain combinations and parts of files.
5
-
These tools are helpful if you modify a number of files and then decide that you want those changes to be in several focused commits rather than one big messy commit.
6
-
This way, you can make sure your commits are logically separate changesets and can be easily reviewed by the developers working with you.
4
+
In this section, you’ll look at a few interactive Git commands that can help you craft your commits to include only certain combinations and parts of files.
5
+
These tools are helpful if you modify a number of files extensively, then decide that you want those changes to be partitioned into several focused commits rather than one big messy commit.
6
+
This way, you can make sure your commits are logically separate changesets and can be reviewed easily by the developers working with you.
7
7
8
8
If you run `git add` with the `-i` or `--interactive` option, Git enters an interactive shell mode, displaying something like this:
9
9
@@ -28,11 +28,11 @@ After this comes a ``Commands'' section, which allows you to do a number of thin
28
28
29
29
==== Staging and Unstaging Files
30
30
31
-
If you type `2` or `u` at the `What now>` prompt, you're prompted for which files you want to stage:
31
+
If you type `u` or `2` (for update) at the `What now>` prompt, you're prompted for which files you want to stage:
@@ -139,7 +139,7 @@ With these basic commands, you can use the interactive add mode to deal with you
139
139
140
140
It’s also possible for Git to stage certain _parts_ of files and not the rest.
141
141
For example, if you make two changes to your `simplegit.rb` file and want to stage one of them and not the other, doing so is very easy in Git.
142
-
From the same interactive prompt explained in the previous section, type `5` or `p` (for patch).
142
+
From the same interactive prompt explained in the previous section, type `p` or `5` (for patch).
143
143
Git will ask you which files you would like to partially stage; then, for each section of the selected files, it will display hunks of the file diff and ask if you would like to stage them, one by one:
0 commit comments