1

I have a private repository that has old credentials and other private information in the git history. I am contracting with an outside party to do some work on the codebase, but I do not want them to have access to the history.

I know that I can give them a copy of the repository without the .git/ folder, but I also want to make it as easy as possible for them to use git while they work, and be able to merge their branch back into my master branch when they are done.

I was thinking of just making a clone with --depth 1, as shown here and here, and sending them a tarball of that local clone. Is there a better way to do this?

reynoldsnlp
  • 1,072
  • 1
  • 18
  • 45

1 Answers1

1
  • if you want to share your initial history :
    have a look at git filter-branch to remove (or edit) the files you don't want to share, then share this version of your repo

  • if you have no need to shareyour old history :
    you can also start a new repo, with the "current tarball" as a first commit, and work on that repo together with the other team ; on your local computer, you can still access your "old" history by stitching it together with your new repo's history.
    See for example this answer to see how to create a new repo, which still keeps the history of an older repo

LeGEC
  • 46,477
  • 5
  • 57
  • 104