DEV Community

Discussion on: Master Git in 7 minutes

Collapse
 
nerd profile image
Dhananjay Panage

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.

Collapse
 
safinghoghabori profile image
Safin Ghoghabori

I think it wont remove from remote repo but staging area.

Collapse
 
valeriavg profile image
Valeria

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.

Collapse
 
vipinkrishna profile image
vipinkrishna

It removes files from from staging/index only

Collapse
 
valeriavg profile image
Valeria

Thank you for the addition!

Collapse
 
zohaib546 profile image
Zohaib Ashraf

this command removes file from your staging area but not locally