I created a Git repo on a server and want it to be used by several people, i.e. users which belong to the same Unix group. It also has a working copy because it may be useful for us to have a common working copy.
Thus I set the owning group of that Git repo directory to that Unix group.
The problem is, every time someone is pushing to that repository, the new files/directories have the owner set to the username of that user and his group but not our common group. Also, all those new files/directories become rwxr-xr-x
.
I tried git config core.sharedRepository group
but that doesn't really work. It now makes files/directories as rwxrwsr-x
but is has still the wrong group set.
Repositories owned by personal accounts have one owner. Ownership permissions can't be shared with another personal account. You can also invite users on GitHub to your repository as collaborators.
You can only add collaborators to your repository. It cannot be "co-owned". The only way for doing what you want is to fork the repo and collaborate through pull requests. Note that you can create an organization ( https://github.com/account/organizations/new ) and achieve a bit of what you want.
Basic Commands/Actions Make a copy of someone else's GitHub repo in your own GitHub account. Make a copy of the your GitHub repo on your local computer. In CLI: 'git clone' copies a remote repo to create a local repo with a remote called origin automatically set up. You incorporate changes into your repo.
Ok, figured it out.
The first important thing (which I did already) was:
git config core.sharedRepository group
The second one was this:
chmod g+s -R .
I would highly recommend you use gitolite for any rights management within an organization and git. This has made management of the repos so much easier.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With