Version-control of specific files on Git [duplicate]
Possible Duplicate:
Git - Whitelisting files in a complex directory structure
I have a project called Basic PHP Framework - alpha and it have some files on root dir.
When I need to apply the FW in some project, I just need to use dirs basic (or file basic.phar), application and files index.php and .htaccess. All other files are for debug purposes.
Here start the "good thing": I want work on projects based on this FW with Git version-control, because sometimes I need do a emergency change on this files and, currently, I need EVERYTIME copy manually to project dir (/basic
) and sync. It's so annoying. The same if I need update project using git.
My idea is something like sync GIT using specific directories and ignoring all others that not interest me, on each project.
It's possible, currently?
I'm new here, and I don't know if here is the right place to post this kind of question. Feel free to move to another "stack-place".
You could add a .gitignore
file in the project directory to blacklist/whitelist any file you don't want git to bother tracker, e.g.:
*
# ignore every file by default
!.htaccess
# but don't ignore .htaccess
!basic
!basic/*
!basic/*/*
# don't ignore the 'basic' directory (and 2 levels below)
!index.php
# etc.
(It's easier to setup a blacklist if "All other files for debug purposes" have some common pattern.)
精彩评论