Skip to main content

Ignoring a file git previously tracked

Problem: you added a file to your .gitignore, but changes are still being tracked because you’ve previously tracked that file.

To fix that and properly ignore the file, you need to remove it from git’s cache:

# remove a specific file from git's cache
git rm --cached filename
# or remove everything from the cache cache
git rm -r --cached .
# commit your changes
git add .
git commit -m "stop tracking ignored files"

Editing checklist


Publishing checklist


  • Title: brainstorm ways to clearly state the topic
  • File name: update to a future-proof topic-subtopic-action hierarchical slug
  • Frontmatter: add all properties:
title: TITLE
description: TL;DR
parent: SLUG # optionally append section id? 
ogImage: mu/IMAGE.jpg
date: 2024-XX-XX
linkSharedOnTwitter: LINK
devLink: LINK
redditLink: LINK
hackerNewsLink: LINK
tags: 
  - post
  • Title: remove inline copy (or teach mu to parse?)
  • Tags: remove inline copy (or teach mu to parse?)
  • Folder: move file to /writing to publish automatically on date set above (may publish a few hours early due to server time, so don’t be surprised to see it immediately if the date is set to tomorrow)
  • Cross post as a YouTube channel community post? Are those silly? For a different purpose?

Inbox


  • #todo generate draft note with a form that includes a tag field and include an embedded query for those tags?