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 3981564
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:25:30+00:00 2026-05-20T05:25:30+00:00

I have a file which has gotten too large, and should be refactored into

  • 0

I have a file which has gotten too large, and should be refactored into two smaller files. What’s the best way to do this in Perforce such that the relationship to the original file is maintained?

I’m adding two new files, and deleting the original in this case, but I would expect there to be some general solution to this problem.

I think the simplest case would be to add one new file which contains a subset of the content of the original, and delete that content from the original file, but leave it in place (it’s trivial to delete it later anyway).

It would be nicest if the operation could be done in a single changelist to avoid any checkins which would break the build.

  • 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-20T05:25:31+00:00Added an answer on May 20, 2026 at 5:25 am

    This can’t be done in a single checking, but it can certainly be done without “breaking the build”. Let’s say you want to split bigFile.cs into smallFile1.cs and smallFile2.cs. First integrate the big file into the two little files and submit them.

    p4 integrate bigFile.cs smallFile1.cs
    p4 integrate bigFile.cs smallFile2.cs
    p4 submit
    

    You now have two extra files in your project directory, but they’re doing no harm. Now check out smallFile1.cs and smallFile2.cs, and your project file(s). Add references to the smaller files, remove the reference to the big, edit the small files accordingly, etc. Finally, mark bigFile.cs for delete and submit your changes.

    You have now split your big file into two smaller files and the smaller files’ history will show you their big file origins.

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

Sidebar

Related Questions

I have a file which has multiple columns, whitespace separated. e.g: data1 data2 data3
Little Background: I have csv file which has lots of rows and each row
Assume you have a file which has been committed in your Git repo. You
I'm using Python, and I have a file which has city names and information
I have a javascript file which has a function calling a server (url) to
I have this xml file which has text init. i.e Hi my name is
I have a text file which has a particular line something like sometext sometext
I have a php file which has some variables like $name1, $name2... How can
i have a binary file which has 4 KB of header information and then
I have a JavaScript file which has a variable as such: var ads =

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.