in Git by
Q:
How to remove a file from git without removing it from your file system?

1 Answer

0 votes
by
One has to be careful during a git add, else you may end up adding files that you didn’t want to commit. However, git rm will remove it from both your staging area (index), as well as your file system (working tree), which may not be what you want.

Instead, use git reset:

git reset filename          # or

echo filename >> .gitingore # add it to .gitignore to avoid re-adding it

This means that git reset <paths> is exactly the opposite of git add <paths>.
Click here to read more about GIT
Click here to read more about Insurance

Related questions

0 votes
asked May 21, 2020 in Git by SakshiSharma
0 votes
asked Oct 26, 2020 in Git by AdilsonLima
0 votes
asked Jun 22, 2019 in PHP by SakshiSharma
0 votes
asked Oct 21, 2020 in JAVA by rahuljain1
+1 vote
asked Sep 12, 2020 in QuickTest Professional (QTP) by JackTerrance
...