├───apps
│ ├───bin
│ │ ├───x64
│ │ │ ├───Debug
│ │ │ └───Release
│ │ └───x86
│ │ ├───Debug
│ │ └───Release
│ └───libs
│ ├───Debug
│ └───Release
└───libs
.gitignore
Now my intention is to setup .gitignore file with following assumptions
1) libs at root and files below should be ignored
2) libs below apps and all files below should be considered for tracking
3) Debug and Release folders under apps\bin\x86|x64 should be ignored
4) Debug and Release folders under apps\libs should be considered for tracking
Help file of git ignore doesn't provide much help about placeholders and skip tokens. Though I wish a regex option could be ideal. After some hit and trial I could come up with following .gitignore file
/libs
*/bin/*/Debug
*/bin/*/Release
With this when I add and check for status I get desired result.
$git add .
$git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
# (use "git rm --cached
#
# new file: .gitignore
# new file: apps/apps1.txt
# new file: apps/libs/Debug/appslibsdebug.txt
# new file: apps/libs/Release/appslibsrelease.txt
# new file: apps/libs/appslibs1.txt
#
2 comments:
I suggest that you mention ".git/info/exclude" in this context including the difference with .gitignore.
AFAIK .gitignore got higher precedence. Also I like ignore file checked in. That way it reflects in server as well as for those who clone it. ./git/info/exclude is local change which got its usage scenarios but not in this case.
Post a Comment