Script to create a shared git project

L'Antre du Tryphon

schedule
2016-07-02 | 04:21h
update
2021-04-11 | 00:47h
person
www.ctheroux.com
domain
www.ctheroux.com

Script to create a shared git project

This script creates a git project to be shared among the users of the Unix group $GIT_GROUP. Every git project will be created into the directory $REPOSITORIES_BASE_DIR.

#!/bin/bash # Base directory where the shared git project are. REPOSITORIES_BASE_DIR="/home/git" # Group in which the user's of the repositories must be a member of GIT_GROUP=git if [ $# -ne 1 ]; then echo 'Usage:' `basename $0` 'project-name' exit 1 fi PROJECT_NAME=$1 cd "$REPOSITORIES_BASE_DIR" git init --shared --bare "$PROJECT_NAME" cd .. find git/$PROJECT_NAME -type d | xargs setfacl -R -m d:g:$GIT_GROUP:rwX sudo setfacl -R -m g:$GIT_GROUP:rwX git/$PROJECT_NAME 
Advertisement

Imprint
Responsible for the content:
www.ctheroux.com
Privacy & Terms of Use:
www.ctheroux.com
Mobile website via:
WordPress AMP Plugin
Last AMPHTML update:
26.04.2024 - 04:22:44
Privacy-Data & cookie usage: