As a beginner got to know a lot because of this, I would like to add one more to it git rm --cached filename it removes files from your repo but still is available locally.
Git rm is the exact opposite of add.
So if you *add*ed files and then called git rm --cached smth it will remove that something from the staged changes. If you didn't change or add anything since the last commit, calling git rm will create this change (as if you would delete the file), staging it for your next commit.
As a beginner got to know a lot because of this, I would like to add one more to it
git rm --cached filename
it removes files from your repo but still is available locally.I think it wont remove from remote repo but staging area.
Git
rm
is the exact opposite ofadd
.So if you *add*ed files and then called
git rm --cached smth
it will remove that something from the staged changes. If you didn't change or add anything since the last commit, callinggit rm
will create this change (as if you would delete the file), staging it for your next commit.It removes files from from staging/index only
Thank you for the addition!
this command removes file from your staging area but not locally