1

The case is following. I should give a copy of a repo to someone as an archive.
There are lots of branches but I want there to be only several.
As far as I know all the branches are copied on a local machine by default even though only master is visible until you switch to another one by git branch.

Say we have: branch1, branch2 and branch3.
I want someone only to be able to access branch1 and branch2 as a result.
How can I achieve this?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Max
  • 135
  • 4

1 Answers1

0

First, if you give a copy of a repository, use git bundle: that will create one file (easy to transfer), without any potentially sensitive information from your local Git repository config.
And the "someone" can then git clone from that file!

Second, when using git bundle create, you can list the branches you want to be included, as I illustrate here.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250