Information Technology Reference
In-Depth Information
Problem
The repository is in a clean state and the working directory contains one file— un-
tracked.txt . The file is unmodified. You want to convert it into an untracked state.
Solution
Start the repository with:
$ cd git-recipes
$ git init 04-06
$ cd 04-06
$ git simple-commit untracked
Right now the repository is clean and the working directory contains one file— un-
tracked.txt .
Follow this procedure:
1. Remove the untracked.txt file with:
$ git rm --cached untracked.txt
2. Check the contents of the repository with the $ ls command. As you
can see the file was not deleted—it still exists in the working directory.
3. Check the status of the repository. The command
$ git status prints:
# On branch master
# Changes to be committed:
#
(use "git reset HEAD <file>..." to unstage)
#
#
deleted:
untracked.txt
#
# Untracked files:
# (use "git add <file>..." to include in what
will be committed)
Search WWH ::




Custom Search