M
M
myskypesla2017-04-27 13:03:29
git
myskypesla, 2017-04-27 13:03:29

How to reset a repository if gitignore didn't download initially?

There is a repository that I cloned, but it clones without .gitingore.
After I cloned, I put 4 folders with pictures and videos in the folder.
After that, I noticed that there is no gitignore file and in my git status it gives out all the files that I uploaded (pictures, videos)
They sent me a customized gitignore file and I copied it to the project folder.
Question: How can I reset the repository so that the folders with pictures and videos are preserved, but the rules from gitignore are taken into account?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
aol-nnov, 2017-04-27
@aol-nnov

I put 4 folders with pictures and videos in the folder

committed?
then you add .gitignore
then git rm --cached afile.ext or git rm -rf --cached afolder
and commit again. the file will remain locally, it will not be included in the commit

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question