git: How do you add an external directory to the repository?

If I need to do something like that I would normally move that external file or directory into my git repo and symlink it’s original location to the new one.

mv /home/some/directory /htdocs/directory
ln -s /htdocs/directory /home/some/
git add ./directory

I use this technique when I am developing a plug-in for an application that I want to keep under version control but have to store in a specific location.

Leave a Comment