go-git-example/README.md

63 lines
1.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## go-git-example
### 运行前准备
本地搭建gitea环境注册一个账号
这里我注册了一个账号用户名为yystopf密码为12345678
另外运行代码前需要拉取依赖
```shell
cd _example
go mod tidy
```
### 创建文件
```shell
cd _example/operate/create
# 示例
go run main.go http://127.0.0.1:10061/yystopf/go-git.git yystopf 12345678
```
### 删除文件
```shell
cd _example/operate/delete
# 示例
go run main.go http://127.0.0.1:10061/yystopf/go-git.git yystopf 12345678
```
### 查看文件
```shell
cd _example/operate/read
# 示例
go run main.go http://127.0.0.1:10061/yystopf/go-git.git yystopf 12345678
```
### 创建文件夹
```shell
cd _example/operate/create/folder
# 示例
go run main.go http://127.0.0.1:10061/yystopf/go-git.git yystopf 12345678
```
### 删除文件夹
```shell
cd _example/operate/delete/folder
# 示例
go run main.go http://127.0.0.1:10061/yystopf/go-git.git yystopf 12345678
```
### 查看文件夹
```shell
cd _example/operate/read/folder
# 示例
go run main.go http://127.0.0.1:10061/yystopf/go-git.git yystopf 12345678 _example
```
###