I have two concise questions:
- How I can track files but without staging them ?
- How I can unstage files for commit without untracking them ?
NOTE: I know that I can do an initial commit to track the files and start from there with my files tracked. But is possible to specifically do what I'm asking above ?
I tried to use git add -N <expr>
but it tracks the file and add it for commit:
PS C:\> git add -N fileA
PS C:\> git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: fileA
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: README.md
# modified: composer.lock
# modified: fileA
#
If I do git reset HEAD fileA
or git rm --cached fileA
unstages it but also untracks the file.
This command git rm fileA
suggest me to use the flag -f that removes the file fisically.
So, It is possible to only track but not stage, and to only unstage but not untrack files ?