Working in a pull request in SourceCraft
To work with pull requests in SourceCraft, including for approvals, you do not need to switch to an IDE on your local computer: you can do all the steps in the SourceCraft interface. You can navigate and search through the project code and edit the code.
Once a pull request is created and published, you can:
- Create a new iteration.
- View changes made to the target branch.
- Leave a comment and request changes.
- Pass a resolution.
- Merge with the target branch.
- Reject a pull request.
Creating a new iteration
Once a pull request is created, each push of changes to a remote repository branch creates a new iteration. This iteration includes all commits made before the git push
command was executed.
To create a new iteration:
-
In the same branch the pull request was created from, make new changes to the repository files.
-
Add the modified files to the
git
index, commit, and push the changes to the remote repository:git add . git commit -m "<comment_to_commit>" git push origin <branch_name>
Your iterations will register all previous changes, even if new commits were sent using the
git push --force
command.Note
You can perform multiple commits and then push the changes to the remote repository. All of them will be included into one iteration.
-
After you create a new iteration, the pull request gets the draft status. Publish it again.
You can make changes to the branch and create a new iteration directly in the SourceCraft interface.
Viewing changes made to the target branch
- Open the SourceCraft home page.
- On the
- Select a repository.
- Under
- Select a pull request.
- View the contents of the pull request:
-
The
-
The
-
To compare changes between iterations, select them from the drop-down lists in the Compare field.
-
To display the file structure, click
For more information, see Navigating and searching by code in SourceCraft.
-
-
The
-
Leaving a comment and requesting changes
-
Open the SourceCraft home page.
-
On the
-
Select a repository.
-
Under
-
Select a pull request.
-
Leave a comment:
GeneralOn a specific rowEnter your comment in the Activity section on the
- On the
- In the window that opens, enter your comment.
- On the
-
Optionally, select Change request to request changes to the pull request.
-
Click Comment.
You can also save your comment as a draft to modify it later instead of publishing it right away. To do this, click Draft.
Passing a resolution
- Open the SourceCraft home page.
- On the
- Select a repository.
- Under
- Select a pull request.
- In the top-right corner, click
- Select a resolution:
Merging with the target branch
Once the pull request is approved, you can perform a merge with the target branch.
- Open the SourceCraft home page.
- On the
- Select a repository.
- Under
- Select a pull request.
- In the top-right corner, click
- Select the method of merging with the target branch:
- Create a merge commit: Separate merge commit is created in the target branch, which saves the revision history of both branches. This gives you a clear idea of when and how the merge had taken place, while keeping the full development history unchanged.
- Squash and merge: Before merging with the target branch, commits from the branch with changes are combined into a single commit. This helps maintain a cleaner and simpler revision history by reducing a series of small commits to a single one.
- Rebase and merge: Commits from the branch with changes are joined to the main branch without creating a special merge commit. This moves commits from the branch with changes to the end of the target branch, preserving a linear revision history.
- In the top-right corner, click
Rejecting a pull request
- Open the SourceCraft home page.
- On the
- Select a repository.
- Under
- Select a pull request.
- In the top-right corner, click