Answer the question
In order to leave comments, you need to log in
Why do stage?
Why do stage, then commit, if you can make a commit without it.
Answer the question
In order to leave comments, you need to log in
Can you tell me how you commit files if you don't tell git to commit them?
https://git-scm.com/book/en/v2
There are files in the workspace - just lying in the directory
. There are files in the stage prepared for commit.
git commit: Commits exactly what is in the stage, not what is in the directory.
git commit -a: Automatically adds all tracked files to stage and commits. But for example, a freshly added file that has not yet been in the git will not be included in the commit.
for example
echo "hello" > a.txt
git commit -m "add a.txt"
echo "hello" > a.txt
git add a.txt
git commit -m "add a.txt"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question