1

Using QtCreator I have the following in my .gitignore

*build-*

This lets me ignore everything inside the buildfolder, which depending on platform and build tools can have different names starting with build-.

Now I would like to unignore subdirectories inside this folder, such as images and backup and I assummed all I had to do was

!build-*/**/

But this has no effect, git status doesn't pick up any of the files in the subdirectories of build-*.

What am I missing?

arynaq
  • 6,710
  • 9
  • 44
  • 74
  • http://stackoverflow.com/questions/5261959/unignore-subdirectories-of-ignored-directories-in-git – Aayushi Jain Mar 27 '17 at 11:52
  • 2
    This is a rather bad idea. You're supposed to delete those build folders at any time, or have very many of them. You're doing something weird - perhaps you should explain why you want build products under source control? – Kuba hasn't forgotten Monica Mar 27 '17 at 15:02
  • If you have anything I can read up on to make testing of builds easier across multiple machines and users I welcome it, this is what I know for now. The application has to create folders and files that need to persist between different builds. – arynaq Mar 27 '17 at 16:38
  • 1
    @arynaq Yes, but if those intermediate files are a direct function of source code files, I could argue that you should not be versioning them. – Tim Biegeleisen Mar 27 '17 at 16:41
  • Further to that, you shouldn't mix and match those two types of files (source and build output) in the same directory. Keep them separate. Everything that is created as part of the build output should be in a separate folder, and since it's generated by the build, never has to be (and never should be) checked in. – Nameless Voice Mar 27 '17 at 21:57

0 Answers0