Create a git repository script

Source: Internet
Author: User

#!/bin/bash

# The script uses the NFS file system, then does a soft connect to the/home/git directory, then sets the appropriate permissions and so on.

#

git_dir=/mnt/nfs/git/

Git_home=/home/git

Read-p "Please input the new project name ..." New_pro


CD $Git _dir


If [-D $New _pro]; Then

RM-RF $New _pro

Mkdir-p $New _pro

Else

Mkdir-p $New _pro

Fi


#chown-R git:git $New _pro


CD $Git _home


Link_repo () {

Ln-s $Git _dir$new_pro $Git _home

CD $New _pro

Git init--bare--shared

Touch Git-daemon-export-ok

Git update-server-info

Chown-r git:git $Git _dir$new_pro

}



If [-l $New _pro]; Then

RM-RF $New _pro

Link_repo

Else

Link_repo

Fi


Create a git repository script

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.