What did you try exactly?
The tutorial ‘tutorials/tree/copytree.C’ shows an example how to do it. By default all branches are copied.
You can change the name of the new tree with newtree->SetName(“newname”) before writing it out to the new file. also, CloneTree accepts an option fast to avoid uncompressing the tree during copy.
Something like this should do it:
TFile *file = TFile::Open("file.root");
TTree *tree = (TTree*)file->Get("name");
// Create a new file, clone tree in new file, change name
TFile *newfile = TFile::Open("newfile.root","recreate");
TTree *newtree = tree->CloneTree(-1, "fast");
newtree->SetName("newname");
newfile->Write();
delete file;
delete newfile;