0 votes
in Git by
How can we remove a file from git without removal from the file system?

1 Answer

0 votes
by

Candidates would have to prepare for this entry among difficult Git interview questions. “git rm” can help in removing files from staging area as well as the file system or working tree. However, the application of “git rm” cannot be valid in all cases. Therefore, you should use the “git reset” command with the syntax like “git reset filename.” You can also use the command “echo filename >> .gitignore” and add it to .gitignore library for avoiding re-additions.

...