Problem Description
Since the code contains some files that do not need to be uploaded, they are generally created in git .gitignore
. For details, please refer to
.gitignore
However, unneeded saved files are often uploaded to the temporary storage area staged
, resulting in .gitignore
no corresponding effect.
Solution
untracked status
git rm -r --cached .
Roll back the contents of the staging area to
git restore --staged <file>
Then, execute
git add .