undefined
undefined

Reputation: 6884

Git remove ignored files after commit

I have the following lines in my gitignore file:

!/assets/path-one/**/*.*
!/assets/path-two/**/*.*
!/assets/path-three/**/*.*

I pushed the changes, and all the files are included in the commit. What I want is to remove the ! and remove all the files from the commit, how can I do this?

/assets/path-one/**/*.*
/assets/path-two/**/*.*
/assets/path-three/**/*.*

When I update the file, I see only the changes in the .gitignore file.

Upvotes: 3

Views: 817

Answers (2)

SAMUEL
SAMUEL

Reputation: 8562

You can acheive it in following setps

  1. You need to remove the folders (Keep a backup of the folders if you want the contents)

  2. update the gitignore by removing (!), add and commit the changes

  3. Replace the backup if you need

Upvotes: 1

samrat shakya
samrat shakya

Reputation: 135

First commit your changes and Try removing cache:

git rm -r --cached .

git add .

git commit -m "fixed untracked files"`

This might help you: https://stackoverflow.com/a/11451731/8866182.

Upvotes: 1

Related Questions