A
A
anriko2020-06-21 13:20:52
git
anriko, 2020-06-21 13:20:52

To add to gitignor, you can add the necessary folders and make another commit, will it be possible to remove them from the git?

commit files, but forgot to add some of them to ignore

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Saboteur, 2020-06-21
@saboteur_kiev

Can't be removed automatically.
Files added to .gitignore will not be automatically committed, but if they already exist in the repository, or you explicitly add any such file, then they will not be deleted by themselves, and their changes will automatically be committed.
Therefore, you need to both add them to .gitignore and explicitly remove them from the repo.

M
Maxim Fedorov, 2020-06-21
@Maksclub

git rm -r --cached .
--cached will tell git what to remove from the index, it will not touch real files
Instead of a dot, you can specify a specific file

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question