Paul D'Ambra
Paul D'Ambra

Reputation: 7824

How to remove existing files from Perforce and ignore them (without deleting them)

I've started working on a Python project using Perforce for VCS that previously only had a single developer.

Currently all the pyc files are in source control which is making merges a pain.

I've seen I can add P4ignore files to keep pyc files out of VCS as carry on working but I need a way to remove them from perforce without removing them from disk.

Or (and this has only occurred to me as I ask the question), as a new-to-python person, can I just delete all the pyc files from VCS (and so from disk) and then let my p4ignore file stop newly created pyc files from getting back into VCS?

Upvotes: 1

Views: 576

Answers (1)

mgilson
mgilson

Reputation: 310287

You can safely delete the .pyc files and then ignore them from here on. Python will automatically generate new .pyc files when the modules are imported/updated.

Generating the .pyc files is quite fast too, so there's no real noticeable performance difference even when python generates new files.

Upvotes: 3

Related Questions