Yes, a regular Git repository (non-bare, with a working copy) can be cloned.
For example, assume your existing repository exists at C:\my-repo\
. You can clone it to C:\my-repo2\
like this:
cd /d c:\
git clone my-repo my-repo2
Cloning it from another machine is a bit different, since you need to open up a network path to your existing repository. On a Linux system I would recommend enabling SSH or using git instaweb
. Of course, both of these can work on Windows, but setting them up isn't nearly as easy.
Looking through the documentation for GitStack, you probably want to follow these instructions for importing an existing repository. Point GitStack at your existing clone and you should be good to go.
A note on push
ing
As Hashem Qolami points out, by default the non-bare repository will not accept a push
to its active (checked-out) branch. You have a few options here.
- Read about
receive.denyCurrentBranch
in git help config
and decide whether you want to enable pushes to the checked out branch. I wouldn't recommend changing this setting, but it should be mentioned as an option.
- Have downstream developers push to a different set of branches. For example, decide that downstream developers will push to branches called
developer-name/branch-name
. Then merge the branches in the upstream repository.
- Instead of having downstream developers
push
into the upstream repository, enable incoming Git connections to downstream machines as well and fetch
(or pull
) downstream changes into the upstream repository.