开发者

Unable to create a bare git repository

开发者 https://www.devze.com 2023-03-16 21:32 出处:网络
My git version is 1.5.0.6. I want to create a bare git repository called sample.git. I tried all sorts, but it failed:

My git version is 1.5.0.6.

I want to create a bare git repository called sample.git.

I tried all sorts, but it failed:

Try 1:

Gives a usage statement but no git created

git init --bare sample.git 
usage: git-init [--template=<template-directory>] [--shared] 

Try 2: (using git-init not git init)

$ git-init --bare sample.git
usage: git-init [--template=<template-directory>] [--shared]

Try 3: Create a directory sample and then run same command, but still same output and git repository not created.

开发者_高级运维

Please help me.


Firstly, upgrade your git. Version 1.5 is positively ancient.

If you can't upgrade, I'd just create a normal git repository, then manually convert it to a bare repo. An ordinary git repo will contain a '.git' directory. This can be your "bare" repo. Rename this directory to whatever you like. (You'll probably want to mv .git ../myrepo.git).

Then you have to tell git that it is a bare repo. Do this by adding bare = true to the config file in the [core] configuration section.

0

精彩评论

暂无评论...
验证码 换一张
取 消