Skip to content

Instantly share code, notes, and snippets.

View LucaCoduriV's full-sized avatar

Luca LucaCoduriV

  • Switzerland
  • 00:02 (UTC +01:00)
View GitHub Profile
@LucaCoduriV
LucaCoduriV / gist:1e48aa7cb573ae1638b4a161310c14cc
Created May 2, 2022 23:02
Untrack files already added to git repository
We couldn’t find that file to show.
@LucaCoduriV
LucaCoduriV / Untrack files already added to git repository.md
Created May 2, 2022 23:03
Untrack files already added to git repository

Step 1: Commit all your changes

Before proceeding, make sure all your changes are committed, including your .gitignore file.

Step 2: Remove everything from the repository

To clear your repo, use:

git rm -r --cached . rm is the remove command -r will allow recursive removal --cached will only remove files from the index. Your files will still be there.