Server-side git

Source: Internet
Author: User

git repositories and bare repositories create warehouses

Git init local repository, including. Git directory and working directory

[Wyq@localhost blog.git]git repository on/home/wyq/workspace/blog.git/.git/[wyq@localhost Blog.git]$ ls-a.  ..  . git   
Create a bare warehouse

Git init--bare the bare repository, only the contents of the. git directory.

[Wyq@localhost blog.git]git repository on/home/wyq/workspace/blog.git/[wyq@localhost Blog.git]$ ls-a.   branches  Description  Hooks  objects.  Config    HEAD info refs    

Suitable as a server repository.

Convert each other

git clone--bare export bare repository from warehouse

git clone export warehouse from bare repository

If the service repository is in git init Itakura, when the user submits the code to it, a

Writing objects:100% (3/3), 236 bytes | 0 bytes/s, done. Total 3 (delta 0), reused 0 (Delta 0) remote:error:refusing toUpdate checked out Branch:refs/heads/masterremote:error:ByDefault, updating theCurrent BranchIn a non-bare repositoryremote:error:is denied, because it'll make the indexandWork Tree Inconsistentremote:error:With what pushed,and would require' Git reset--hard 'ToMatchremote:error:theWork treeTo HEAD.remote:error:remote:error:You canSet' Receive.denycurrentbranch ' configuration variableToremote:error:' Ignore 'Or' Warn 'In the remote repositoryTo allow pushingintoremote:error:its current branch; However, this was not recommended Unless youremote:error:arranged to update its  Work tree to match what you pushed in someremote:error:other way.remote:error:remote:error: to squelch this message and still keep the default behaviour, setremote:error: Span class= "string" > ' receive.denycurrentbranch ' configuration variable to  ' refuse '. to/home/wyq/workspace/blog.git! [Remote rejected] master, master (branch is currently checked out)    

The workaround is to use Git clone--bare to clone the. Git content as a server repository.

Server-side git

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.