Pull requests
Pull requests foster collaboration within your team, ensuring code changes go through required reviews, approvals, and checks before being merged to the base branch.
Create pull requests
-
In your repository, go to Pull Requests and select New Pull Request.
-
Select the base branch and the branch you want to merge into the base branch.
-
You can edit the Title and enter a Description.
-
Select Create pull request to submit your PR for review.
To save your PR as a draft, select the dropdown next to Create pull request, and then select Create draft pull request.
You can also create a PR by comparing branches. In your repository, go to Branches, locate the branch that you want to compare against the base branch, select More options (⋮), and then select Compare.
Request reviews
To request a reviews from other users in your Gitness instance:
-
In your repository, go to Pull Requests and select your PR.
-
On the Conversation tab, in the Reviewers section, select Add.
-
Select the user that you want to assign as a reviewer.
To review PRs, the user must be a project member.
To remove a reviewer, select More options (⋮) next to the reviewer's name, and then select Remove.
When reviewers leave comments on your PR, you can reply and resolve comments on either the Conversation or Changes tabs.
Submit reviews
Reviewers can leave feedback, approve, or reject PRs. Anyone with sufficient permission in the project can review PRs without being assigned as a reviewer.
-
In your repository, go to Pull Requests and select the PR you need to review.
-
On the Conversation tab, you can read the PR description and add comments.
-
On the Changes tab, you can review the code changes and add line-by-line comments.
Select the
+
icon to comment on a single line.Select and drag the
+
icon to comment on multiple lines. -
If everything looks good, you can select Approve to approve the PR for merge.
To request changes, select the dropdown next to Approve and select Request changes.
To leave feedback without a decision, you can add comments on the Changes or Conversation tab.
On a PR's Changes tab, you can mark files as Viewed to collapse the diff. This is useful when reviewing PRs with lots of changed files.
If a file is changed after you mark it as viewed, the file is marked as Change since last viewed, so you don't have to manually check for changes to viewed files.
Gitness also tracks file deletions and additions. Assume that a file was deleted in a PR, and you marked it as viewed. If that file is later restored in the PR, Gitness marks the file appropriately so you can review it in its restored state.
Status checks
A status check appears for each pipeline configured in your repository. A failing pipeline results in a failing status check.
Merge pull requests
Gitness automatically checks for potential merge conflicts in PRs. If conflicts are found, merging is blocked until you resolve the conflicts.
If all checks have passed, you can select a merge strategy:
- Squash and merge: All commits from the source branch are combined into one commit in the base branch.
- Merge pull request: All commits from the source branch are added to the base branch via a merge commit.
- Rebase and merge: All commits from the source branch are rebased and added to the base branch.
Squash and merge is the default strategy. To select another strategy, select the dropdown next to Squash and merge.
Learn more about merge strategies
Close pull requests
-
In your repository, go to Pull Requests and select the PR you want to close.
-
Select the dropdown next to Squash and merge, and select Close pull request.
-
Select Close pull request again to confirm the closure.
To reopen the PR, select Open for review.