.gitignore for multi projects - Visual Studio

Asked

Viewed 131 times

3

Setting

I have a versioned project on github, put together a file .gitignore to make the project lighter and not to unnecessarily restore files, but I’m not succeeding. Note that my file .gitignore is at the root of the project.

Doubt

All the files I’ve put into . gitignore continue to versioning. How do I resolve ?

Structure of the Project

.\70-483
|-----.git
|-----\Manageprogramflow
|------|____________\Weblank.Manageprogramflow
|--------------------|____________________/.vs
|--------------------|____________________/IMAP
|--------------------|____________________/Usingasyncawait
|--------------------|____________________/Usingconcurrentcollections
|--------------------|____________________Weblank.ManageProgramFlow.sln
|-----.gitignore
|-----LICENSE.Md
|--------README.Md

Part of . gitignore

inserir a descrição da imagem aqui

Part of the Github Project

inserir a descrição da imagem aqui

Project link on github http://www.github.com/weblank/70-483

  • What is the question?

  • All the files I’ve put into . gitignore continue to versioning. How do I resolve ?

1 answer

1


You can remove the cache of the archives and thus the gitignore will begin to ignore files that have already been comitados.

As a basis, I will use this test project:

Projeto inicial do Git

For this just run the command below:

git  rm -r  --cached   .
    └┬┘ └┬┘ └───┬───┘ └┬┘
     │   │      │      └─── Pasta ou arquivo que você deseja remover o cache
     │   │      └───────────── Desassociar e remover caminhos apenas do índice.
     │   └──────────────────── Recursividade (em caso de pasta)
     └──────────────────────── Remove arquivos da árvore de trabalho e do índice

Once done, we will have the result below if we execute git status

Resultado após o código acima

Now we need commit the amendments:

git commit -m "Atualiza cache do gitignore"

And now we’ll have the files that weren’t ignored, like untracked files.

Resultado

Browser other questions tagged

You are not signed in. Login or sign up in order to post.