Skip to content

Instantly share code, notes, and snippets.

View raduserbanescu's full-sized avatar

Radu Serbanescu raduserbanescu

  • Buzau, Romania
View GitHub Profile
@tsrivishnu
tsrivishnu / gitignore_already_tracked_file.md
Last active February 23, 2024 08:09
Git: Ignore already checked in file

Git: How can I ignore a file that is already committed to the repo?

You have a repo and quite some developers have cloned the repo and working on it. Now you want to add a file to gitignore which is already checked-in or tracked by Git.(The file is already commited into the repo)

Below are the steps on how to ignore this file (lets say the filename is config.py):

  • Add it to .gitignore:

$ echo "config.py" >> .gitignore