Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
a8b940fa
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a8b940fa
编写于
10月 17, 2018
作者:
J
James Lopez
提交者:
Evan Read
10月 17, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add Git protocol v2 docs
上级
da1a2bd6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
98 addition
and
0 deletion
+98
-0
doc/administration/git_protocol.md
doc/administration/git_protocol.md
+97
-0
doc/administration/index.md
doc/administration/index.md
+1
-0
未找到文件。
doc/administration/git_protocol.md
0 → 100644
浏览文件 @
a8b940fa
---
description
:
"
Set
and
configure
Git
protocol
v2"
---
# Configuring Git Protocol v2
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/46555) in GitLab 11.4.
---
Git protocol v2 improves the v1 wire protocol in several ways and is
enabled by default in GitLab for HTTP requests. In order to enable SSH,
further configuration is needed by the administrator.
More details about the new features and improvements are available in
the
[
Google Open Source Blog
](
https://opensource.googleblog.com/2018/05/introducing-git-protocol-version-2.html
)
and the
[
protocol documentation
](
https://github.com/git/git/blob/master/Documentation/technical/protocol-v2.txt
)
.
## Requirements
From the client side,
`git`
`v2.18.0`
or newer must be installed.
From the server side, if we want to configure SSH we need to set the
`sshd`
server to accept the
`GIT_PROTOCOL`
environment,
```
# /etc/ssh/sshd_config
AcceptEnv GIT_PROTOCOL
```
Once configured, restart the SSH daemon. In Ubuntu, run:
```
sh
sudo
service ssh restart
```
## Instructions
In order to use the new protocol, clients need to either pass the configuration
`-c protocol.version=2`
to the git command, or set it globally:
```
sh
git config
--global
protocol.version 2
```
### HTTP connections
Verify Git v2 is used by the client:
```
sh
GIT_TRACE_CURL
=
1 git
-c
protocol.version
=
2 ls-remote https://your-gitlab-instance.com/group/repo.git 2>&1 |
grep
Git-Protocol
```
You should see that the
`Git-Protocol`
header is sent:
```
16:29:44.577888 http.c:657 => Send header: Git-Protocol: version=2
```
Verify Git v2 is used by the server:
```
sh
GIT_TRACE_PACKET
=
1 git
-c
protocol.version
=
2 ls-remote https://your-gitlab-instance.com/group/repo.git 2>&1 |
head
```
Example response using Git protocol v2:
```
sh
$ GIT_TRACE_PACKET
=
1 git
-c
protocol.version
=
2 ls-remote https://your-gitlab-instance.com/group/repo.git 2>&1 |
head
10:42:50.574485 pkt-line.c:80 packet: git<
# service=git-upload-pack
10:42:50.574653 pkt-line.c:80 packet: git< 0000
10:42:50.574673 pkt-line.c:80 packet: git< version 2
10:42:50.574679 pkt-line.c:80 packet: git<
agent
=
git/2.18.1
10:42:50.574684 pkt-line.c:80 packet: git< ls-refs
10:42:50.574688 pkt-line.c:80 packet: git<
fetch
=
shallow
10:42:50.574693 pkt-line.c:80 packet: git< server-option
10:42:50.574697 pkt-line.c:80 packet: git< 0000
10:42:50.574817 pkt-line.c:80 packet: git< version 2
10:42:50.575308 pkt-line.c:80 packet: git<
agent
=
git/2.18.1
```
### SSH Connections
Verify Git v2 is used by the client:
```
sh
GIT_SSH_COMMAND
=
"ssh -v"
git
-c
protocol.version
=
2 ls-remote ssh://your-gitlab-instance.com:group/repo.git 2>&1 |grep GIT_PROTOCOL
```
You should see that the
`GIT_PROTOCOL`
environment variable is sent:
```
debug1: Sending env GIT_PROTOCOL = version=2
```
For the server side, you can use the
[
same examples from HTTP
](
#http-connections
)
, changing the
URL to use SSH.
doc/administration/index.md
浏览文件 @
a8b940fa
...
...
@@ -130,6 +130,7 @@ created in snippets, wikis, and repos.
-
[
Custom Git hooks
](
custom_hooks.md
)
: Custom Git hooks (on the filesystem) for when webhooks aren't enough.
-
[
Git LFS configuration
](
../workflow/lfs/lfs_administration.md
)
: Learn how to configure LFS for GitLab.
-
[
Housekeeping
](
housekeeping.md
)
: Keep your Git repositories tidy and fast.
-
[
Configuring Git Protocol v2
](
git_protocol.md
)
: Git protocol version 2 support.
## Monitoring GitLab
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录