Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
4f5bb980
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,体验更适合开发者的 AI 搜索 >>
提交
4f5bb980
编写于
2月 13, 2017
作者:
A
Achilleas Pipinellis
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move merge requests index file inside the merge_requests dir
[ci skip]
上级
b609ee55
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
178 addition
and
180 deletion
+178
-180
doc/user/project/merge_requests.md
doc/user/project/merge_requests.md
+1
-169
doc/user/project/merge_requests/index.md
doc/user/project/merge_requests/index.md
+169
-0
doc/user/project/merge_requests/versions.md
doc/user/project/merge_requests/versions.md
+7
-10
doc/workflow/README.md
doc/workflow/README.md
+1
-1
未找到文件。
doc/user/project/merge_requests.md
浏览文件 @
4f5bb980
# Merge Requests
Merge requests allow you to exchange changes you made to source code and
collaborate with other people on the same project.
## Authorization for merge requests
There are two main ways to have a merge request flow with GitLab:
1.
Working with
[
protected branches
][]
in a single repository
1.
Working with forks of an authoritative project
[
Learn more about the authorization for merge requests.
](
merge_requests/authorization_for_merge_requests.md
)
## Cherry-pick changes
Cherry-pick any commit in the UI by simply clicking the
**Cherry-pick**
button
in a merged merge requests or a commit.
[
Learn more about cherry-picking changes.
](
merge_requests/cherry_pick_changes.md
)
## Merge when pipeline succeeds
When reviewing a merge request that looks ready to merge but still has one or
more CI builds running, you can set it to be merged automatically when CI
pipeline succeeds. This way, you don't have to wait for the pipeline to finish
and remember to merge the request manually.
[
Learn more about merging when pipeline succeeds.
](
merge_requests/merge_when_pipeline_succeeds.md
)
## Resolve discussion comments in merge requests reviews
Keep track of the progress during a code review with resolving comments.
Resolving comments prevents you from forgetting to address feedback and lets
you hide discussions that are no longer relevant.
[
Read more about resolving discussion comments in merge requests reviews.
](
merge_requests/merge_request_discussion_resolution.md
)
## Resolve conflicts
When a merge request has conflicts, GitLab may provide the option to resolve
those conflicts in the GitLab UI.
[
Learn more about resolving merge conflicts in the UI.
](
merge_requests/resolve_conflicts.md
)
## Revert changes
GitLab implements Git's powerful feature to revert any commit with introducing
a
**Revert**
button in merge requests and commit details.
[
Learn more about reverting changes in the UI
](
merge_requests/revert_changes.md
)
## Merge requests versions
Every time you push to a branch that is tied to a merge request, a new version
of merge request diff is created. When you visit a merge request that contains
more than one pushes, you can select and compare the versions of those merge
request diffs.
[
Read more about the merge requests versions.
](
merge_requests/versions.md
)
## Work In Progress merge requests
To prevent merge requests from accidentally being accepted before they're
completely ready, GitLab blocks the "Accept" button for merge requests that
have been marked as a
**Work In Progress**
.
[
Learn more about settings a merge request as "Work In Progress".
](
merge_requests/work_in_progress_merge_requests.md
)
## Ignore whitespace changes in Merge Request diff view
If you click the
**Hide whitespace changes**
button, you can see the diff
without whitespace changes (if there are any). This is also working when on a
specific commit page.
![
MR diff
](
merge_requests/img/merge_request_diff.png
)
>**Tip:**
You can append
`?w=1`
while on the diffs page of a merge request to ignore any
whitespace changes.
## Tips
Here are some tips that will help you be more efficient with merge requests in
the command line.
> **Note:**
This section might move in its own document in the future.
### Checkout merge requests locally
A merge request contains all the history from a repository, plus the additional
commits added to the branch associated with the merge request. Here's a few
tricks to checkout a merge request locally.
Please note that you can checkout a merge request locally even if the source
project is a fork (even a private fork) of the target project.
#### Checkout locally by adding a git alias
Add the following alias to your
`~/.gitconfig`
:
```
[alias]
mr = !sh -c 'git fetch $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' -
```
Now you can check out a particular merge request from any repository and any
remote. For example, to check out the merge request with ID 5 as shown in GitLab
from the
`upstream`
remote, do:
```
git mr upstream 5
```
This will fetch the merge request into a local
`mr-upstream-5`
branch and check
it out.
#### Checkout locally by modifying `.git/config` for a given repository
Locate the section for your GitLab remote in the
`.git/config`
file. It looks
like this:
```
[remote "origin"]
url = https://gitlab.com/gitlab-org/gitlab-ce.git
fetch = +refs/heads/*:refs/remotes/origin/*
```
You can open the file with:
```
git config -e
```
Now add the following line to the above section:
```
fetch = +refs/merge-requests/*/head:refs/remotes/origin/merge-requests/*
```
In the end, it should look like this:
```
[remote "origin"]
url = https://gitlab.com/gitlab-org/gitlab-ce.git
fetch = +refs/heads/*:refs/remotes/origin/*
fetch = +refs/merge-requests/*/head:refs/remotes/origin/merge-requests/*
```
Now you can fetch all the merge requests:
```
git fetch origin
...
From https://gitlab.com/gitlab-org/gitlab-ce.git
* [new ref] refs/merge-requests/1/head -> origin/merge-requests/1
* [new ref] refs/merge-requests/2/head -> origin/merge-requests/2
...
```
And to check out a particular merge request:
```
git checkout origin/merge-requests/1
```
[
protected branches
]:
protected_branches.md
This document was moved to
[
merge_requests/index.md
](
merge_requests/index.md
)
.
doc/user/project/merge_requests/index.md
0 → 100644
浏览文件 @
4f5bb980
# Merge requests
Merge requests allow you to exchange changes you made to source code and
collaborate with other people on the same project.
## Authorization for merge requests
There are two main ways to have a merge request flow with GitLab:
1.
Working with
[
protected branches
][]
in a single repository
1.
Working with forks of an authoritative project
[
Learn more about the authorization for merge requests.
](
authorization_for_merge_requests.md
)
## Cherry-pick changes
Cherry-pick any commit in the UI by simply clicking the
**Cherry-pick**
button
in a merged merge requests or a commit.
[
Learn more about cherry-picking changes.
](
cherry_pick_changes.md
)
## Merge when pipeline succeeds
When reviewing a merge request that looks ready to merge but still has one or
more CI builds running, you can set it to be merged automatically when CI
pipeline succeeds. This way, you don't have to wait for the pipeline to finish
and remember to merge the request manually.
[
Learn more about merging when pipeline succeeds.
](
merge_when_pipeline_succeeds.md
)
## Resolve discussion comments in merge requests reviews
Keep track of the progress during a code review with resolving comments.
Resolving comments prevents you from forgetting to address feedback and lets
you hide discussions that are no longer relevant.
[
Read more about resolving discussion comments in merge requests reviews.
](
merge_request_discussion_resolution.md
)
## Resolve conflicts
When a merge request has conflicts, GitLab may provide the option to resolve
those conflicts in the GitLab UI.
[
Learn more about resolving merge conflicts in the UI.
](
resolve_conflicts.md
)
## Revert changes
GitLab implements Git's powerful feature to revert any commit with introducing
a
**Revert**
button in merge requests and commit details.
[
Learn more about reverting changes in the UI
](
revert_changes.md
)
## Merge requests versions
Every time you push to a branch that is tied to a merge request, a new version
of merge request diff is created. When you visit a merge request that contains
more than one pushes, you can select and compare the versions of those merge
request diffs.
[
Read more about the merge requests versions.
](
versions.md
)
## Work In Progress merge requests
To prevent merge requests from accidentally being accepted before they're
completely ready, GitLab blocks the "Accept" button for merge requests that
have been marked as a
**Work In Progress**
.
[
Learn more about settings a merge request as "Work In Progress".
](
work_in_progress_merge_requests.md
)
## Ignore whitespace changes in Merge Request diff view
If you click the
**Hide whitespace changes**
button, you can see the diff
without whitespace changes (if there are any). This is also working when on a
specific commit page.
![
MR diff
](
img/merge_request_diff.png
)
>**Tip:**
You can append
`?w=1`
while on the diffs page of a merge request to ignore any
whitespace changes.
## Tips
Here are some tips that will help you be more efficient with merge requests in
the command line.
> **Note:**
This section might move in its own document in the future.
### Checkout merge requests locally
A merge request contains all the history from a repository, plus the additional
commits added to the branch associated with the merge request. Here's a few
tricks to checkout a merge request locally.
Please note that you can checkout a merge request locally even if the source
project is a fork (even a private fork) of the target project.
#### Checkout locally by adding a git alias
Add the following alias to your
`~/.gitconfig`
:
```
[alias]
mr = !sh -c 'git fetch $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' -
```
Now you can check out a particular merge request from any repository and any
remote. For example, to check out the merge request with ID 5 as shown in GitLab
from the
`upstream`
remote, do:
```
git mr upstream 5
```
This will fetch the merge request into a local
`mr-upstream-5`
branch and check
it out.
#### Checkout locally by modifying `.git/config` for a given repository
Locate the section for your GitLab remote in the
`.git/config`
file. It looks
like this:
```
[remote "origin"]
url = https://gitlab.com/gitlab-org/gitlab-ce.git
fetch = +refs/heads/*:refs/remotes/origin/*
```
You can open the file with:
```
git config -e
```
Now add the following line to the above section:
```
fetch = +refs/merge-requests/*/head:refs/remotes/origin/merge-requests/*
```
In the end, it should look like this:
```
[remote "origin"]
url = https://gitlab.com/gitlab-org/gitlab-ce.git
fetch = +refs/heads/*:refs/remotes/origin/*
fetch = +refs/merge-requests/*/head:refs/remotes/origin/merge-requests/*
```
Now you can fetch all the merge requests:
```
git fetch origin
...
From https://gitlab.com/gitlab-org/gitlab-ce.git
* [new ref] refs/merge-requests/1/head -> origin/merge-requests/1
* [new ref] refs/merge-requests/2/head -> origin/merge-requests/2
...
```
And to check out a particular merge request:
```
git checkout origin/merge-requests/1
```
[
protected branches
]:
protected_branches.md
doc/user/project/merge_requests/versions.md
浏览文件 @
4f5bb980
# Merge requests versions
> Will be [introduced][ce-5467] in GitLab 8.12.
>**Notes:**
-
[
Introduced
][
ce-5467
]
in GitLab 8.12.
-
Comments are disabled while viewing outdated merge versions or comparing to
versions other than base.
-
Merge request versions are based on push not on commit. So, if you pushed 5
commits in a single push, it will be a single option in the dropdown. If you
pushed 5 times, that will count for 5 options.
Every time you push to a branch that is tied to a merge request, a new version
of merge request diff is created. When you visit a merge request that contains
...
...
@@ -30,13 +36,4 @@ changes appears as a system note.
![
Merge request versions system note
](
img/versions_system_note.png
)
---
>**Notes:**
-
Comments are disabled while viewing outdated merge versions or comparing to
versions other than base.
-
Merge request versions are based on push not on commit. So, if you pushed 5
commits in a single push, it will be a single option in the dropdown. If you
pushed 5 times, that will count for 5 options.
[
ce-5467
]:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5467
doc/workflow/README.md
浏览文件 @
4f5bb980
...
...
@@ -27,7 +27,7 @@
-
[
Web Editor
](
../user/project/repository/web_editor.md
)
-
[
Releases
](
releases.md
)
-
[
Milestones
](
milestones.md
)
-
[
Merge Requests
](
../user/project/merge_requests.md
)
-
[
Merge Requests
](
../user/project/merge_requests
/index
.md
)
-
[
Authorization for merge requests
](
../user/project/merge_requests/authorization_for_merge_requests.md
)
-
[
Cherry-pick changes
](
../user/project/merge_requests/cherry_pick_changes.md
)
-
[
Merge when pipeline succeeds
](
../user/project/merge_requests/merge_when_pipeline_succeeds.md
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录