1

This might seem like a noob question but i couldn't find any solution to it. I have an apigility project cloned from the original repository. I have deleted the .git directory and kept the .gitignore file :

   nbproject
   ._*
   .~lock.*
   .buildpath
   .DS_Store
   .idea
   .project
   .settings
   composer.lock
   vendor/
   public/vendor/
   config/development.config.php
   config/autoload/local.php
   config/autoload/*.local.php
   !public/vendor/README.md
   data/cache/*
   !data/cache/.gitkeep

I have then made a "git init" in the root folder and my git repository was created. I have made a "git add .gitignore" and made an initial commit with it. After I tried to make a "git add ." but all my files are getting added to the staging area. I can't understand why because for example the .puppet directory is added to the .gitignore and it still gets added. I gave a shot to this solution Ignore files that have already been committed to a Git repository it doesn't solve my issue.

Community
  • 1
  • 1
Susy11
  • 260
  • 1
  • 3
  • 15
  • There is no `.puppet` directory listed in that `.gitignore` file... – larsks Mar 16 '15 at 18:42
  • it is maybe I forgot to paste it in the example. the composer.lock and the public/vendor can be considered valid examples as well. – Susy11 Mar 16 '15 at 19:26
  • Can you also include in your question (a) the output of `ls` in the top-level directory and (b) the output of `git status` after you have performed the `git add` operation? – larsks Mar 16 '15 at 19:29
  • In almost every case, composer.lock should be in your repository, not ignored. – David Stockton May 14 '15 at 05:29

1 Answers1

0

If the structure is:

 yourrepo/
    .git/
    .gitignore
    yourfiles

Then a git add . would respect the .gitignore.
If not, a git rm --cached -- wrongfile would remove it from the index, and a git status would ignore it because of the .gitignore.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250