Information Technology Reference
In-Depth Information
4-1. Staging and committing a new file
Problem
You want to create a new file and commit it into the repository. You also would like to
get familiar with the changes performed by every command executed in this recipe. To
achieve this you need to analyze the state of the repository with the $ git status
and $ git status -s commands.
Solution
Start a new repository with:
$ cd git-recipes
$ git init 04-01
$ cd 04-01
Then, follow this procedure:
1. Create a new file with $ echo new > new.txt
2. Check the status of the repository. The output of the $ git status
will be the following:
# On branch master
#
# Initial commit
#
# Untracked files:
# (use "git add <file>..." to include in what
will be committed)
#
# new.txt
nothing added to commit but untracked files
present (use "git add" to track)
As you can see the new.txt file is listed as untracked .
Search WWH ::




Custom Search