Change order of operations

  so that a minimum amount of copies (ie 2) of the repo
  are on the disk at the same time.