Skip to content

Commit b64476c

Browse files
committed
short status
1 parent 7a332b2 commit b64476c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

book/02-git-basics/1-git-basics.asc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,22 @@ Changes to be committed:
236236
modified: benchmarks.rb
237237
----
238238

239+
==== Short Status
240+
241+
While the `git status` output is pretty comprehensive, it's also quite wordy. Git also has a short status flag so you can see your changes in a more compact way. If you run `git status -s` or `git status --short` you get a far more simplified output from the command.
242+
243+
[source,shell]
244+
----
245+
$ git status -s
246+
M README
247+
MM Rakefile
248+
A lib/git.rb
249+
M lib/simplegit.rb
250+
?? LICENSE.txt
251+
----
252+
253+
New files that aren't tracked have a `??` next to them, new files that have been added to the staging area have an `A`, modified files have an `M` and so on. There are two columns to the output - the left hand column indicates that the file is staged and the right hand column indicates that it's modified. So for example in that output, the `README` file is modified in the working directory but not yet staged, while the `lib/simplegit.rb` file is modified and staged. The `Rakefile` was modified, staged and then modified again, so there are changes to it that are both staged and unstaged.
254+
239255
==== Ignoring Files
240256

241257
Often, you’ll have a class of files that you don’t want Git to automatically add or even show you as being untracked.

0 commit comments

Comments
 (0)