I have a Git repository that contains a Libs directory in the root. This directory contains all the compiled .lib files that I want to include in the repository and push to main repo. The structure of Libs directory is:
Libs
...--| x64
........--| Release
........--| Debug
The problem is that I am unable to make Git include LIB files inside Release and Debug folders. I think its because Release and Debug folders are excluded by gitignore:
# Build results
[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/
What I tried:
!/Libs/*/*.lib
!/Libs/x64/Release/*
You would need to use:
In order to add them in spite of the .gitignore.
You can check at any time which .gitignore and which rules of the
.gitignore
is preventing you to consider a particular folder with:For modifying your
.gitignore
to not ignore a particular sub-folder, consider ".gitignore exclude folder but include specific sub-folder", especially:For instance, in your case try (git 1.8.2+):
Note that with git 2.9.x/2.10 (mid 2016?), it might be possible to re-include a file if a parent directory of that file is excluded if there is no wildcard in the path re-included.
Nguyễn Thái Ngọc Duy (
pclouds
) is trying to add this feature:That means, with git 2.9+, this could have worked: