Home > Mobile >  How can I create a shared repo using "git clone"?
How can I create a shared repo using "git clone"?

Time:10-26

The "git init" command has a parameter --shared which, from my reading, creates a repo with permission bits set to allow multiple people to access and update the repo.

I want to create the same type of repo but this time using "git clone". It too has a --shared parameter but from my reading does something totally different.

How can I clone a repo so that the cloned repo has the same permission bits as a "git init" with the --shared parameter ?

CodePudding user response:

You can try the workaround of:

git init --shared aFolder
cd aFolder
git remote add origin /url/repo/to/clone
git fetch
git switch main

That way, you init first, then import the remote repository, instead of cloning it directly.

  • Related