Ignoring git folder inside repository

2

How do I ignore .git / and .gitignore folders within my project?

I'm having problems cloning external vendors in my project because of this, every time I clone / down some dependency with the composer it comes with the git folder and when I commit the changes to the folder containing the .git / not send or add in git add --all     

asked by anonymous 25.08.2015 / 13:45

1 answer

2

In many dependency managers, it is a good practice not to include files downloaded by the manager into your repository, always being downloaded through the manager. If so, add the manager files / folders to .gitignore .

If you prefer to download other repositories within yours, you can use submodules.

To add a submodule to your project use:

git submodule add https://github.com/chaconinc/DbConnector

Where the URL will be from the repository you are downloading.

When cloning a repository with submodules, they will come empty by default. To download, use:

git submodule init
git submodule update

This will update the settings and download the repository of the submodule.

    
25.08.2015 / 19:01