1

I want to ignore all files whithin the Binaries folder except dll files in that folder.

# Ignore all files and folders
Binaries/*

# Dont ignore dll files
!Binaries/*/*.dll

With this, all files and folders get ignored. Even dll files.

But i want to allow dll files. For example

Binaries/Win64/someName.dll

Should NOT be ignored.

Please help. P4 ignore file name is ".gitignore"

M.kazem Akhgary
  • 18,645
  • 8
  • 57
  • 118

1 Answers1

1

I think you want:

# Ignore everything under Binaries except .dll files
Binaries/
!Binaries/**.dll

Testing this out gets me:

C:\Perforce\test>p4 add -n Binaries/foo
//stream/main/Binaries/foo#1 - opened for add
c:\Perforce\test\Binaries\foo - ignored file can't be added.

C:\Perforce\test>p4 add -n Binaries/Win64/someName.dll
//stream/main/Binaries/Win64/someName.dll#1 - opened for add

which seems correct for your use case.

Samwise
  • 68,105
  • 3
  • 30
  • 44
  • does it matter where .gitignore file is placed? given you example mine is placed in `c:\Perforce\ ` directory and not in `c:\Perforce\test\ ` – M.kazem Akhgary May 03 '20 at 08:18
  • Run `p4 set P4IGNORE=.gitignore` to tell `p4` the name of your ignore file. – Samwise May 03 '20 at 14:57
  • I already did that, and it works for everything else. except for `!Binaries/**.dll`. I figured I have to write the path explicitly to make it work. i.e `!MyProject/Binaries/Win64/*.dll` and so on. It's not good but it gets the job done. – M.kazem Akhgary May 04 '20 at 11:05