
---
url: /mod/git/sp.md
---
# x git sp

主要为优化中国地区访问 Bitbucket、Codeberg、GitHub、GitLab 而设, 包括配置短名和设定代理

## 例子

对 github,gitlab,codeberg,bitbucket 设置 http, https, socks5 代理，地址为 localhost:9999；这是最为常用的场景

```sh
x git sp setup localhost:9999

```

查看当前服务提供商的配置状态

```sh
x git sp status

```

清除 setup 设置的内容

```sh
x git sp cleanup
```

配置短名和使用 http、SSH 协议设置代理

```sh
x git sp setup --http socks5://localhost:9999 --ssh localhost:9999

```

## 子命令

| 名称 | 描述 |
| ------- | ------- |
| [x git sp setup](#x-git-sp-setup) | 初始化配置服务提供商短名和设定代理 |
| [x git sp cleanup](#x-git-sp-cleanup) | 清除 setup 设置的内容 |
| [x git sp status](#x-git-sp-status) | 查看当前服务提供商的配置状态 |


### x git sp setup

初始化配置服务提供商短名和设定代理


- **例子**:

对 github,gitlab,codeberg,bitbucket 设置 http, https, socks5 代理，地址为 localhost:9999；这是最为常用的场景

```sh
x git sp setup localhost:9999

```

设置短名和使用 http、SSH 协议设置代理

```sh
x git sp setup --http socks5://localhost:9999 --ssh localhost:9999

```

- **使用**:

```sh
x git sp setup [OPTIONS]
```

- **选项**:


| 名称, 名称简写 | 默认值 | 描述 |
| ------- | ------- | ------- |
| `--http` |  | 使用 http 协议设置代理 |
| `--ssh` |  | 使用 SSH 协议设置代理 |
| `--proxy` |  | 同时使用 http 和 SSH 协议设置代理 |


### x git sp cleanup

清除 setup 设置的内容


- **使用**:

```sh
x git sp cleanup
```

### x git sp status

查看当前服务提供商的配置状态


- **使用**:

```sh
x git sp status
```