How to untrack a file in Git

0 votes

Hi Guys,

I installed git in my windows system. I added of one file in staging area by mistake. How can I untrack that file?

May 4, 2020 in Git & GitHub by akhtar
• 38,260 points
13,466 views

1 answer to this question.

0 votes

Hi@akhtar,

You can untrack your file from git by using the below given command.

$ git rm -r --cached <file>

Hope this will help.

answered May 4, 2020 by MD
• 95,460 points

Related Questions In Git & GitHub

0 votes
1 answer

How to give a file execute mode permissions in Git?

You can easily do this in one ...READ MORE

answered Aug 7, 2018 in Git & GitHub by Sophie may
• 10,620 points
21,048 views
0 votes
1 answer

How to force git to completely forget about a file that is present in .gitignore folder?

Hi@akhtar, gitignore file is a text file that tells Git which files or ...READ MORE

answered Dec 22, 2020 in Git & GitHub by MD
• 95,460 points
3,631 views
0 votes
0 answers

How to find and restore a deleted file in a Git repository?

Hi Team, I have one Git repository. I ...READ MORE

Dec 22, 2020 in Git & GitHub by akhtar
• 38,260 points
844 views
0 votes
1 answer

How do I go to a particular version of a file in the Git repository?

Hi@akhtar, You can use git checkout <sha1> to check ...READ MORE

answered Jan 5, 2021 in Git & GitHub by MD
• 95,460 points
2,907 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,034 views
+2 votes
1 answer
0 votes
1 answer

How to untrack and remove a deleted file and log when we check git status ?

Hi@Shashi, You can use the git clean command. ...READ MORE

answered Oct 29, 2020 in Git & GitHub by MD
• 95,460 points
18,662 views
0 votes
1 answer

How to unstage a file in Git?

Hi@akhtar, Sometimes we accidentally add files in the ...READ MORE

answered Nov 19, 2020 in Git & GitHub by MD
• 95,460 points
827 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP