How do I make a git server accessible to multiple users?
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I have set up a git server, but I'm having some problems with users pushing their commits. I have a total of 3 users, but if any one of them pushes some files, they become read-only for the other users, and the unpacker fails if they try to push.
I can temporarily fix this issue by recursively setting all permissions to 777
but that is a terrible approach and only fixes it until the next push.
How can I make it so that all selected users can both push and pull, without having to change permissions every single time?
permissions git
add a comment |Â
up vote
2
down vote
favorite
I have set up a git server, but I'm having some problems with users pushing their commits. I have a total of 3 users, but if any one of them pushes some files, they become read-only for the other users, and the unpacker fails if they try to push.
I can temporarily fix this issue by recursively setting all permissions to 777
but that is a terrible approach and only fixes it until the next push.
How can I make it so that all selected users can both push and pull, without having to change permissions every single time?
permissions git
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I have set up a git server, but I'm having some problems with users pushing their commits. I have a total of 3 users, but if any one of them pushes some files, they become read-only for the other users, and the unpacker fails if they try to push.
I can temporarily fix this issue by recursively setting all permissions to 777
but that is a terrible approach and only fixes it until the next push.
How can I make it so that all selected users can both push and pull, without having to change permissions every single time?
permissions git
I have set up a git server, but I'm having some problems with users pushing their commits. I have a total of 3 users, but if any one of them pushes some files, they become read-only for the other users, and the unpacker fails if they try to push.
I can temporarily fix this issue by recursively setting all permissions to 777
but that is a terrible approach and only fixes it until the next push.
How can I make it so that all selected users can both push and pull, without having to change permissions every single time?
permissions git
edited Mar 14 at 20:13
Michael Homer
42.4k6108148
42.4k6108148
asked Mar 14 at 20:04
user2894959
111
111
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
Create your repository with git init --shared
, which will:
Specify that the Git repository is to be shared amongst several users. This allows users belonging to the same group to push into that repository. When specified, the config variable "core.sharedRepository" is set so that files and directories under
$GIT_DIR
are created with the requested permissions.
Put all the users who should have write access into the same group, and Git (including the various SSH and smart server elements) will create the files group-writable and g+sx
. You may want to create a special group to use for that and chgrp -R
the repository to it.
This will also enable the receive.denyNonFastForwards
setting on the repository, which you can disable manually if required.
All the users are in thegit
group, the permissions bits areg+sx
on all files, but pushing still fials with:Already up-to-date. Pushing to mariusz@CENSORED:/srv/git/website.git remote: error: insufficient permission for adding an object to repository database ./objects remote: fatal: failed to write object error: unpack failed: unpack-objects abnormal exit To mariusz@CENSORED:/srv/git/website.git ! [remote rejected] master -> master (unpacker error) error: failed to push some refs to 'mariusz@CENSORED:/srv/git/website.git'
â user2894959
Mar 14 at 20:39
Create the repository in the first place with--shared
, don't try to fake it. It does a bit of work behind the scenes.
â Michael Homer
Mar 14 at 20:44
So the only option is to re-create it?
â user2894959
Mar 14 at 20:45
It's not the only option, of course, but it's the sensible one. It's git, all copies are the same, you don't lose anything.
â Michael Homer
Mar 14 at 20:46
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Create your repository with git init --shared
, which will:
Specify that the Git repository is to be shared amongst several users. This allows users belonging to the same group to push into that repository. When specified, the config variable "core.sharedRepository" is set so that files and directories under
$GIT_DIR
are created with the requested permissions.
Put all the users who should have write access into the same group, and Git (including the various SSH and smart server elements) will create the files group-writable and g+sx
. You may want to create a special group to use for that and chgrp -R
the repository to it.
This will also enable the receive.denyNonFastForwards
setting on the repository, which you can disable manually if required.
All the users are in thegit
group, the permissions bits areg+sx
on all files, but pushing still fials with:Already up-to-date. Pushing to mariusz@CENSORED:/srv/git/website.git remote: error: insufficient permission for adding an object to repository database ./objects remote: fatal: failed to write object error: unpack failed: unpack-objects abnormal exit To mariusz@CENSORED:/srv/git/website.git ! [remote rejected] master -> master (unpacker error) error: failed to push some refs to 'mariusz@CENSORED:/srv/git/website.git'
â user2894959
Mar 14 at 20:39
Create the repository in the first place with--shared
, don't try to fake it. It does a bit of work behind the scenes.
â Michael Homer
Mar 14 at 20:44
So the only option is to re-create it?
â user2894959
Mar 14 at 20:45
It's not the only option, of course, but it's the sensible one. It's git, all copies are the same, you don't lose anything.
â Michael Homer
Mar 14 at 20:46
add a comment |Â
up vote
1
down vote
Create your repository with git init --shared
, which will:
Specify that the Git repository is to be shared amongst several users. This allows users belonging to the same group to push into that repository. When specified, the config variable "core.sharedRepository" is set so that files and directories under
$GIT_DIR
are created with the requested permissions.
Put all the users who should have write access into the same group, and Git (including the various SSH and smart server elements) will create the files group-writable and g+sx
. You may want to create a special group to use for that and chgrp -R
the repository to it.
This will also enable the receive.denyNonFastForwards
setting on the repository, which you can disable manually if required.
All the users are in thegit
group, the permissions bits areg+sx
on all files, but pushing still fials with:Already up-to-date. Pushing to mariusz@CENSORED:/srv/git/website.git remote: error: insufficient permission for adding an object to repository database ./objects remote: fatal: failed to write object error: unpack failed: unpack-objects abnormal exit To mariusz@CENSORED:/srv/git/website.git ! [remote rejected] master -> master (unpacker error) error: failed to push some refs to 'mariusz@CENSORED:/srv/git/website.git'
â user2894959
Mar 14 at 20:39
Create the repository in the first place with--shared
, don't try to fake it. It does a bit of work behind the scenes.
â Michael Homer
Mar 14 at 20:44
So the only option is to re-create it?
â user2894959
Mar 14 at 20:45
It's not the only option, of course, but it's the sensible one. It's git, all copies are the same, you don't lose anything.
â Michael Homer
Mar 14 at 20:46
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Create your repository with git init --shared
, which will:
Specify that the Git repository is to be shared amongst several users. This allows users belonging to the same group to push into that repository. When specified, the config variable "core.sharedRepository" is set so that files and directories under
$GIT_DIR
are created with the requested permissions.
Put all the users who should have write access into the same group, and Git (including the various SSH and smart server elements) will create the files group-writable and g+sx
. You may want to create a special group to use for that and chgrp -R
the repository to it.
This will also enable the receive.denyNonFastForwards
setting on the repository, which you can disable manually if required.
Create your repository with git init --shared
, which will:
Specify that the Git repository is to be shared amongst several users. This allows users belonging to the same group to push into that repository. When specified, the config variable "core.sharedRepository" is set so that files and directories under
$GIT_DIR
are created with the requested permissions.
Put all the users who should have write access into the same group, and Git (including the various SSH and smart server elements) will create the files group-writable and g+sx
. You may want to create a special group to use for that and chgrp -R
the repository to it.
This will also enable the receive.denyNonFastForwards
setting on the repository, which you can disable manually if required.
answered Mar 14 at 20:13
Michael Homer
42.4k6108148
42.4k6108148
All the users are in thegit
group, the permissions bits areg+sx
on all files, but pushing still fials with:Already up-to-date. Pushing to mariusz@CENSORED:/srv/git/website.git remote: error: insufficient permission for adding an object to repository database ./objects remote: fatal: failed to write object error: unpack failed: unpack-objects abnormal exit To mariusz@CENSORED:/srv/git/website.git ! [remote rejected] master -> master (unpacker error) error: failed to push some refs to 'mariusz@CENSORED:/srv/git/website.git'
â user2894959
Mar 14 at 20:39
Create the repository in the first place with--shared
, don't try to fake it. It does a bit of work behind the scenes.
â Michael Homer
Mar 14 at 20:44
So the only option is to re-create it?
â user2894959
Mar 14 at 20:45
It's not the only option, of course, but it's the sensible one. It's git, all copies are the same, you don't lose anything.
â Michael Homer
Mar 14 at 20:46
add a comment |Â
All the users are in thegit
group, the permissions bits areg+sx
on all files, but pushing still fials with:Already up-to-date. Pushing to mariusz@CENSORED:/srv/git/website.git remote: error: insufficient permission for adding an object to repository database ./objects remote: fatal: failed to write object error: unpack failed: unpack-objects abnormal exit To mariusz@CENSORED:/srv/git/website.git ! [remote rejected] master -> master (unpacker error) error: failed to push some refs to 'mariusz@CENSORED:/srv/git/website.git'
â user2894959
Mar 14 at 20:39
Create the repository in the first place with--shared
, don't try to fake it. It does a bit of work behind the scenes.
â Michael Homer
Mar 14 at 20:44
So the only option is to re-create it?
â user2894959
Mar 14 at 20:45
It's not the only option, of course, but it's the sensible one. It's git, all copies are the same, you don't lose anything.
â Michael Homer
Mar 14 at 20:46
All the users are in the
git
group, the permissions bits are g+sx
on all files, but pushing still fials with: Already up-to-date. Pushing to mariusz@CENSORED:/srv/git/website.git remote: error: insufficient permission for adding an object to repository database ./objects remote: fatal: failed to write object error: unpack failed: unpack-objects abnormal exit To mariusz@CENSORED:/srv/git/website.git ! [remote rejected] master -> master (unpacker error) error: failed to push some refs to 'mariusz@CENSORED:/srv/git/website.git'
â user2894959
Mar 14 at 20:39
All the users are in the
git
group, the permissions bits are g+sx
on all files, but pushing still fials with: Already up-to-date. Pushing to mariusz@CENSORED:/srv/git/website.git remote: error: insufficient permission for adding an object to repository database ./objects remote: fatal: failed to write object error: unpack failed: unpack-objects abnormal exit To mariusz@CENSORED:/srv/git/website.git ! [remote rejected] master -> master (unpacker error) error: failed to push some refs to 'mariusz@CENSORED:/srv/git/website.git'
â user2894959
Mar 14 at 20:39
Create the repository in the first place with
--shared
, don't try to fake it. It does a bit of work behind the scenes.â Michael Homer
Mar 14 at 20:44
Create the repository in the first place with
--shared
, don't try to fake it. It does a bit of work behind the scenes.â Michael Homer
Mar 14 at 20:44
So the only option is to re-create it?
â user2894959
Mar 14 at 20:45
So the only option is to re-create it?
â user2894959
Mar 14 at 20:45
It's not the only option, of course, but it's the sensible one. It's git, all copies are the same, you don't lose anything.
â Michael Homer
Mar 14 at 20:46
It's not the only option, of course, but it's the sensible one. It's git, all copies are the same, you don't lose anything.
â Michael Homer
Mar 14 at 20:46
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f430250%2fhow-do-i-make-a-git-server-accessible-to-multiple-users%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password