Set up, merge, and remove local cache properly