Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Devops
  3. Question
Devops

git untrack folder-Remove a folder from git tracking

Asked by Aalap Prabhakaran Jun 3, 2021 12.6K views 3 answers
Share

About this question

I need to exclude a folder (name uploads) from tracking. I tried to run

git rm -r --cached wordpress/wp-content/uploads

and after that, I added the path to .gitignore

/wordpress/wp-content/uploads

but when I ran git status t they show up as deleted. If I try to commit the changes, the files will be deleted, not only removed from tracking.

What am I doing wrong?

I have also tried

git update-index --assume-unchanged 

but this seems to untrack only files. But I need to remove an entire folder (including subfolders) from tracking.

Your answer

3 Answers

Ranjana Admin JanBask Expert Latest answer

Answered on Feb 21, 2025

If you want to remove a folder from Git tracking but keep it locally, follow these steps:


1. Stop Tracking the Folder

Git tracks files even if they are removed from the repository. To untrack a folder:

  git rm -r --cached folder_name

Was this helpful?

Ranjana Admin JanBask Expert

Answered on Apr 25, 2024


In SQL Server, you can convert a varchar to an int using either the CAST or CONVERT functions. Here's how:

Using CAST:

SELECT CAST('123' AS INT) AS ConvertedValue;

Using CONVERT:

SELECT CONVERT(INT, '123') AS ConvertedValue;

These commands will convert the string '123' to an integer value of 123. Just ensure that the varchar value you're converting contains valid numeric characters, as attempting to convert non-numeric strings may result in errors.


Was this helpful?

More Devops discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest DevOps Blogs

Guides, tips and career advice on DevOps from JanBask experts.