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