mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-08-01 16:04:19 +00:00
add screenshots to gitlab-flow article
This commit is contained in:
@ -95,7 +95,7 @@ In this flow it is not common to have a production branch (or git flow master br
|
||||
|
||||
# Merge/pull requests with GitLab flow
|
||||
|
||||
![Merge request with line comments]() Merge or pull requests are created in a git management application and ask an assigned person to merge two branches.
|
||||
 Merge or pull requests are created in a git management application and ask an assigned person to merge two branches.
|
||||
Tools such as GitHub and Bitbucket choose the name pull request since the first manual action would be to pull the feature branch.
|
||||
Tools such as GitLab and Gitorious choose the name merge request since that is the final action that is requested of the assignee.
|
||||
In this article we'll refer to them as merge requests.
|
||||
@ -118,7 +118,7 @@ So if you want to merge it into a protected branch you assign it to someone with
|
||||
|
||||
# Issues with GitLab flow
|
||||
|
||||
![Merge request with the branch name 15-require-a-password-to-change-it and assignee field shown]() GitLab flow is a way to make the relation between the code and the issue tracker more transparent.
|
||||
 GitLab flow is a way to make the relation between the code and the issue tracker more transparent.
|
||||
|
||||
Any significant change to the code should start with an issue where the goal is described.
|
||||
Having a reason for every code change is important to inform everyone on the team and to help people keep the scope of a feature branch small.
|
||||
@ -150,7 +150,7 @@ It is possible that one feature branch solves more than one issue.
|
||||
|
||||
# Linking and closing issues from merge requests
|
||||
|
||||
![Merge request showing the linked issues that will be closed]() Linking to the issue can happen by mentioning them from commit messages (fixes #14, closes #67, etc.) or from the merge request description.
|
||||
 Linking to the issue can happen by mentioning them from commit messages (fixes #14, closes #67, etc.) or from the merge request description.
|
||||
In GitLab this creates a comment in the issue that the merge requests mentions the issue.
|
||||
And the merge request shows the linked issues.
|
||||
These issues are closed once code is merged into the default branch.
|
||||
@ -161,7 +161,7 @@ If you have an issue that spans across multiple repositories, the best thing is
|
||||
|
||||
# Squashing commits with rebase
|
||||
|
||||
![Vim screen showing the rebase view]() With git you can use an interactive rebase (rebase -i) to squash multiple commits into one and reorder them.
|
||||
 With git you can use an interactive rebase (rebase -i) to squash multiple commits into one and reorder them.
|
||||
This functionality is useful if you made a couple of commits for small changes during development and want to replace them with a single commit or if you want to make the order more logical.
|
||||
However you should never rebase commits you have pushed to a remote server.
|
||||
Somebody can have referred to the commits or cherry-picked them.
|
||||
@ -185,7 +185,7 @@ Git management software will always create a merge commit when you accept a merg
|
||||
|
||||
# Do not order commits with rebase
|
||||
|
||||
![List of sequencial merge commits]() With git you can also rebase your feature branch commits to order them after the commits on the master branch.
|
||||
 With git you can also rebase your feature branch commits to order them after the commits on the master branch.
|
||||
This prevents creating a merge commit when merging master into your feature branch and creates a nice linear history.
|
||||
However, just like with squashing you should never rebase commits you have pushed to a remote server.
|
||||
This makes it impossible to rebase work in progress that you already shared with your team which is something we recommend.
|
||||
@ -220,13 +220,13 @@ If you rebase code the history is incorrect, and there is no way for tools to re
|
||||
|
||||
# Voting on merge requests
|
||||
|
||||
![Voting slider in GitLab]() It is common to voice approval or disapproval by using +1 or -1 emoticons.
|
||||
 It is common to voice approval or disapproval by using +1 or -1 emoticons.
|
||||
In GitLab the +1 and -1 are aggregated and shown at the top of the merge request.
|
||||
As a rule of thumb anything that doesn't have two times more +1's than -1's is suspect and should not be merged yet.
|
||||
|
||||
# Pushing and removing branches
|
||||
|
||||
![Remove checkbox for branch in merge requests]() We recommend that people push their feature branches frequently, even when they are not ready for review yet.
|
||||
 We recommend that people push their feature branches frequently, even when they are not ready for review yet.
|
||||
By doing this you prevent team members from accidentally starting to work on the same issue.
|
||||
Of course this situation should already be prevented by assigning someone to the issue in the issue tracking software.
|
||||
However sometimes one of the two parties forgets to assign someone in the issue tracking software.
|
||||
@ -238,7 +238,7 @@ When you reopen an issue you need to create a new merge request.
|
||||
|
||||
# Committing often and with the right message
|
||||
|
||||
![Good and bad commit message]() We recommend to commit early and often.
|
||||
 We recommend to commit early and often.
|
||||
Each time you have a functioning set of tests and code a commit can be made.
|
||||
The advantage is that when an extension or refactor goes wrong it is easy to revert to a working version.
|
||||
This is quite a change for programmers that used SVN before, they used to commit when their work was ready to share.
|
||||
@ -252,7 +252,7 @@ To see more information about the formatting of commit messages please see this
|
||||
|
||||
# Testing before merging
|
||||
|
||||
![Merge requests showing the test states, red, yellow and green]() In old workflows the Continuous Integration (CI) server commonly ran tests on the master branch only.
|
||||
 In old workflows the Continuous Integration (CI) server commonly ran tests on the master branch only.
|
||||
Developers had to ensure their code did not break the master branch.
|
||||
When using GitLab flow developers create their branches from this master branch so it is essential it is green.
|
||||
Therefore each merge request must be tested before it is accepted.
|
||||
@ -267,7 +267,7 @@ If you have long lived feature branches that last for more than a few days you s
|
||||
|
||||
# Merging in other code
|
||||
|
||||
![Shell output showing git pull output]() When initiating a feature branch, always start with an up to date master to branch off from.
|
||||
 When initiating a feature branch, always start with an up to date master to branch off from.
|
||||
If you know beforehand that your work absolutely depends on another branch you can also branch from there.
|
||||
If you need to merge in another branch after starting explain the reason in the merge commit.
|
||||
If you have not pushed your commits to a shared location yet you can also rebase on master or another feature branch.
|
||||
|
Reference in New Issue
Block a user