1

Here's the situation. I have a commercial application developed in PHP. I'll have to add features to it, but none of the original files will be touched. I need to work ONLY on my new files. How do I manage this situation in Git?

In my gitignore I specified * to ignore everything and a negation ! for my new files, but it's really boring. I don't want to add a new line to gitignore everytime I create a new file.

Any solution?

PS: this script don't support plugins so is not a solution to just "git init" my plugin folder. Anyway It's developed using MVC so I'll be adding controllers and views.

tereško
  • 58,060
  • 25
  • 98
  • 150
Sebastian
  • 21
  • 4
  • 5
    Why don't you want to add the original files to Git as well? Even you're not going to modify them, it would be useful to record the versions of those files that your new work has been developed against. (Maybe there's some licensing restriction?) – Jeremy Nov 04 '14 at 23:34
  • Gitignore doesn't elimite the "original" files as part of the repository, so there's no benefit to using it in your case. Let Git do what it does and be happy. – isherwood Nov 04 '14 at 23:36
  • Because this software have an 1-click update feature and - I think - this can create trouble when pulling from the repository, am I right? – Sebastian Nov 04 '14 at 23:38
  • 1
    Having the original files as part of the repository will protect you against accidental (or intentional) modifications to them. If you .gitignore them and they change without your knowledge, git won't be able to tell you. – jcm Nov 04 '14 at 23:44

1 Answers1

0

You might consider a local pre-commit hook.
That hook can:

If you haven't touched (committed) any other files yet, that hook will ensure you would be working only on your new files.

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