How to retain revision history when cloning a Conda environment?

Viewed 99

When I clone a Conda environment

conda create --name thenewenv --clone theorigenv

I noticed the revision history of theorigenv is lost as seen by

conda activate thenewenv
conda list -r

How can I clone a Conda environment and retain the original environment's revision history?

1 Answers

It appears that copying the conda-meta/history file from the original environment will retain the history

cp envs/theorigenv/conda-meta/history envs/thenewenv/conda-meta/history

It even seems to work with reverting to earlier revisions, e.g.,

conda install -n thenewenv --revision <n> 
Related