Linux to create a git repository

Source: Internet
Author: User
Tags chmod

#Create a workspacemkdirtest_work#Create a git repository (service library, non-workspaces)mkdirtest_git CD test_gitgit init--Bare#Create a post-receive hook that automatically updates the code to the workspace after the code is submitted Test_workVim./hooks/post-Receive#!/bin/shGit_work_tree=test_work git checkout-Fsudochmod-R 777test_work#write the above three lines of shell into the post-receive file,#above test_work is your workspace, path write absolute path#after writing, save exit Vim editor#Modify the user and user groups for the workspace to have permission updates for git receive hooksChownGit:git-R test_work#Modify the user and user groups of the Test_git warehouse and add execute permissions to the Post-receive fileChownGit:git-R test_gitchmod+x test_git/hooks/post-receive

Linux to create a git repository

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.