Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to remove a file from git without removing it from your file system?



How to remove a file from git without removing it from your file system?..

Answer / Amol Kumar

To remove a file from Git without deleting it from your file system, follow these steps:n1. Remove the file from your working directory.n2. Add the file to the .gitignore file to prevent it from being added back to Git.n3. Run `git rm --cached <file>` to remove the file from Git's index without affecting the file in your working directory.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Git Interview Questions

What is git and why do we use it?

1 Answers  


How do you find a list of files that have changed in a particular commit?

1 Answers  


What are the benefits of using version control system?

1 Answers  


What is ‘git status’ is used for?

1 Answers  


What is the function of git clone?

1 Answers  


What is a git commit and what does the commit object contain?

1 Answers  


What is the purpose of branching in GIT?

1 Answers  


What does ‘hooks’ comprise of in git?

1 Answers  


What is git bisect? How can you use it to determine the source of a (regression) bug?

1 Answers  


What is the function of ‘git stash apply’?

1 Answers  


What is git reflog?

1 Answers  


What language is used in GIT?

1 Answers  


Categories