Information Technology Reference
In-Depth Information
3. Check the shortened output of git status. The command
$ git status -s will print:
?? new.txt
Untracked files are denoted with ?? .
4. Stage the file using the $ git add new.txt command.
5. Check the status of the repository. The output of $ git status would
be:
# On branch master
#
# Initial commit
#
# Changes to be committed:
#
(use "git rm --cached <file>..." to unstage)
#
#
new file:
new.txt
#
This time the file is displayed under the Changes to be committed
section. This means that the file was staged.
6. Check the status with the $ git status -s command. The com-
mand will print:
A_ new.txt
This new state shown consists of two characters A and space. To make
the output more readable, I used an underscore _ instead of a space.
7. Create a new revision with
$ git commit -m "Staging and committing a new
file"
8. Check the status with the $ git status -s command. The output is
empty, thus the repository is clean.
Search WWH ::




Custom Search