> For the complete documentation index, see [llms.txt](https://pshizhsysu.gitbook.io/git/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pshizhsysu.gitbook.io/git/ben-di-cang-ku/ban-ben-guan-li/chuang-jian-ban-ben-ku.md).

# 创建版本库

## 创建版本库

首先，选择一个合适的地方，创建一个空目录

```
$ mkdir learngit
$ cd learngit
$ pwd
/home/docker/gitRoot/learngit
```

第二步，初始化该目录为一个git仓库

```
$ git init
```

该步执行完后，learngit目录下将会出现一个.git目录，且会创建一个master分

## 添加文件

首先，在learngit目录下创建并编辑一个新文件readme.txt

```
$ cat readme.txt
git is a version control system
git is free software
```

然后，把该文件添加到暂存区

```
$ git add readme.txt
```

最后，提交修改到版本库中

```
git commit -m "add readme.txt"
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pshizhsysu.gitbook.io/git/ben-di-cang-ku/ban-ben-guan-li/chuang-jian-ban-ben-ku.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
