A
A
Alexis178422015-08-18 14:44:22
git
Alexis17842, 2015-08-18 14:44:22

How do I "tell" git to ignore a file that has already been in multiple commits (git .ignore doesn't work for some reason)?

Forgot to add some files to git .ignore initially.
Accordingly, they ended up in several commits, and I don’t need them there at all.
When you add the names of these git .ignore files, nothing happens. Git continues to handle them diligently.
What could be the reason for this behavior and how can it be overcome?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
TyzhSysAdmin, 2015-08-18
@Alexis17842

git rm --cached file.txt

I
Ilya Popov, 2015-08-18
@encyclopedist

To be honest, your question is not entirely clear.
But if you added some information to the repository, and now you want git to forget it forever, including removing a file from the commit history (for example, a file with a password, or personal information), then look here:
https://help.github .com/articles/remove-sensitive-data/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question