How do I remove a file from history?

Asked by Stuart P. Bentley

I have a project where I'm developing a library, and I also included a file for a test application. I've decided now that I want to keep the main branch free of any applications and do any apps in branches, so how can I change the main branch to only include the other files in its history (as in, making a branch with all the same files except the app one and swapping the branches afterward)?

Question information

Language:
English Edit question
Status:
Answered
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Martin Pool (mbp) said :
#1

I think you can do this history editing using bzr-rewrite?

Revision history for this message
Marius Kruger (amanica) said :
#2

You can just remove the subdirectories from your main branch. (see also bzr split --help)
I would not recommend rewriting history unless you don't want to disclose your secret source recipes or the additional history is really too big to hunk around.

Revision history for this message
Stuart P. Bentley (stuart) said :
#3

@Martin Pool: How would I do that?
@Marius Kruger: The file isn't in a subdirectory.

Revision history for this message
Marius Kruger (amanica) said :
#4

Well as I said you can just remove it: `bzr remove unneededfile` .
But if it is very big or if it contains secret stuff then you can try rewriting history.
To that you can use the lp:bzr-fastimport plugin see:
http://doc.bazaar.canonical.com/plugins/en/fastimport-plugin.html#fast-import-filter

Can you help with this problem?

Provide an answer of your own, or ask Stuart P. Bentley for more information if necessary.

To post a message you must log in.