Git on IBM in IFS causing permission conflicts, can't force permission of index file - Stack Overflow

We have a git repository setup for our locally run ApachePHP server. Everything on it works, except fo

We have a git repository setup for our locally run Apache/PHP server. Everything on it works, except for pulling.

Whenever someone does a git pull in the production repo, it changes the permissions on many different files. So we have a post-merge hook on the repo that does the following (which we've used on Linux servers successfully):

#! /QOpenSys/usr/bin/sh

echo "Fixing permissions, please be patient..."
find /path/to/htdocs -type d -exec chmod -f 775 {} \;
find /path/to/htdocs -type f -exec chmod -f 664 {} \;
find /path/to/htdocs/.git/hooks -type f -exec chmod -f 771 {} \;
chown -Rf someuser:programgroup /path/to/htdocs
chmod -Rf +x /path/to/htdocs/.git/hooks

This works on most files, but there are a few that it just doesn't change at all, one important one being .git/index. Git sets the permissions to the index file to be -rw-rw-r-- 1 pull_usr programgroup, and the hook doesn't change this at all.

This makes it so any normal programmer can't pull to the same repo later on to put changes onto the live server, even though they're also in the programgroup group. And, for some odd reason, whenever the current "owner" of the file tries to manually change the permissions, they get chown: .git/index: Not owner.

The error we get when trying to pull as anyone else is error: unable to write new index file.

I've tried looking up how to maybe make the hook run using a higher privileged user, but since PASE has no su or sudo, it's pretty much a dead end.

Is there any way to get this to properly set the permissions after a pull so whoever needs to can put their changes live after approval?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745079795a4610053.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信