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,130 points
1,322 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
• 94,990 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 6, 2018 in Git & GitHub by Sophie may
• 10,510 points
6,062 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
• 94,990 points
18 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,130 points
65 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 in Git & GitHub by MD
• 94,990 points
37 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 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
883 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 28, 2020 in Git & GitHub by MD
• 94,990 points
199 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
• 94,990 points
182 views