packrat restore when switching between git branches with different packages

77 Views Asked by At

I'm making large changes to an R project on a different git branch which includes changes to packrat packages and versions. When I switch back to the original master branch after making those changes, I need to run packrat::restore() to get back to the original project state because I am only tracking the packrat.lock file. Then, if I switch back to the development branch I have to run packrat::restore() again to pick up where I left off with the new changes.

Do I have this correct? Can you suggest a better workflow that eliminates the need to run packrat::restore() which can take a lot of time?

This also makes it difficult to schedule jobs to run automatically from the master branch. I have to make sure to switch to the master branch and run packrat::restore() before scripts are scheduled to run, and I can't work on the development branch while the background jobs are running.

0

There are 0 best solutions below