Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 874159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:03:47+00:00 2026-05-15T11:03:47+00:00

We use Visual Studio, which generates lots of bin and obj directories. When I

  • 0

We use Visual Studio, which generates lots of bin and obj directories. When I use P4V‘s “Reconcile Offline Work” feature, these appear in the “Local files not in depot” list.

I’d like to exclude them. I found this question, but that talks about files, and when I try what it suggests (adding the following to my workspace view), it doesn’t work:

//depot/Foo/... //Client/Foo/...
-//depot/Foo/.../*.user //Client/Foo/.../*.user
-//depot/Foo/.../bin/... //Client/Foo/.../bin/...
-//depot/Foo/.../obj/... //Client/Foo/.../obj/...

It doesn’t actually seem to work for files, either: the foo.csproj.user files are still displayed in the list.

Can I exclude directories from P4V? If so, how? What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T11:03:48+00:00Added an answer on May 15, 2026 at 11:03 am

    Updated answer:
    This has been somewhat tricky in the past, because there was no built-in way to exclude a directory from a Perforce command. Since 2012 this has changed.
    You can have a look at a nice perforce article for this problem.

    As of 2012.1, the P4IGNORE environment variable can be set to designate a file to be used to exclude files from Perforce. Both the Perforce Server (p4d) and client (p4, P4V) need to be 2012.1 or greater. P4IGNORE‘s purpose is to ignore files when adding new files to the depot and reconciling workspaces. Like comparable features in other version control systems, P4IGNORE cannot be used to ignore files already under the repository’s control.

    P4Eclipse manages .p4ignore files on its own terms.
    (see the manual regarding this point here)

    Using client views to exclude files and directories:

    The traditional method for excluding files and directories in Perforce is to use exclusionary client mappings. See the command reference for Views for full documentation. Example view:

    View:

    //depot/... //test_ws/depot/...
    -//depot/dir/etc/... //test_ws/depot/dir/etc/...
    

    This view will prevent files in dir/etc from being added to the depot. If trying to exclude the directory from read-only queries, use client or relative syntax.

    $ p4 files //depot/dir/etc/...
    //depot/dir/etc/foo#1 - add change 1186 (text)
    //depot/dir/etc/bar#1 - add change 1186 (text) 
    
    
    $ p4 files //test_ws/dir/etc/...
    //test_ws/test_ignore/ignoredir/... - file(s) not in client view. 
    
    $ cd dir/etc
    $ p4 files ...
    ... - file(s) not in client view.
    

    Alternatively, you can use shell commands to filter your output as desired.

    p4 files //depot/dir/... |
        awk -F# '{print $1}' |
        grep -v "//depot/dir/etc/" |
        p4 -x - fstat
    

    which runs p4 fstat on all files under “//depot/dir/“, except for those files under “//depot/dir/etc/“. This directory exclusion is accomplished by listing all of the files, and then using grep to remove those files under the directory to be excluded. The trailing slash in “//depot/dir/etc/” is necessary to prevent matching directories under “//depot/dir/” that start with “etc” (for example, “//depot/dir/etc2009“).

    Note:

    The awk command assumes there are no file names containing the “#” character.
    The grep command can also read its patterns from a file, which is useful if you need to exclude multiple directories.
    We use the ‘-x -‘ flags with the p4 command to use the input as arguments to the corresponding command; see the Perforce Command Line Global Options for more information.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Today I tried to use the publishing feature with visual studio, which creates an
Which .PDB file does Visual Studio use if you use the attach to process
MSTest + Visual Studio generates accessors which appear on the NCover coverage report. They
I use Visual Studio 2005 & C#. In my FormClosing event I release some
i use visual studio 2008, and i chose a .cpp in visual c++ at
I use visual studio for day to day programming (read putting food in my
I use Visual Studio .NET to create a Windows-based application. The application includes a
I use Visual Studio .NET to develop a component named X_Component and I plan
I use Visual Studio 2008 and it really makes me crazy how it shows
I use Visual Studio .NET to develop internal applications. I create a Windows control

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.