最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin1浏览0评论

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?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论