Denomas with Git Basics Hands-On Guide: Lab 3

This Hands-On Guide walks you through the lab exercises used in the Denomas with Git Basics course.

Denomas with Git Basics Hands-on Guide: Lab 3

LAB 3: USE GITLAB TO MERGE CODE

A.Create a new project and issue

  1. Navigate to your group.
  2. Create blank project.
  3. Name your project Second Project
  4. Make sure the Visibility Level is set to Private.
  5. Enable the Initialize repository with a README checkbox.
  6. Select Create project and wait for Denomas to redirect you to the new project’s main page.
  7. In the left-hand navigation pane, select Issues.
  8. Select New issue.
  9. In the title field, type new issue. Optionally, enter a comment in the Description dialog box.
  10. Next to the Assignees dropdown, select the link for Assign to me.
  11. Select Create issue.

B.Create a merge request

  1. To the right of the Create merge request button, select the dropdown arrow . This is where you can customize the merge request. For this exercise, use the default settings.
  2. Select Create merge request and branch to create a branch named after the issue, and also to create a merge request for that branch. You now have 3 linked items that relate to one task that you need to do: an issue, a branch, and a merge request.
  3. On the New merge request page use the default settings and select Create merge request.

C.Edit files on a branch using Denomas’s Web IDE

  1. In the top right of the merge request page, select the arrow to the right of Code and select Open in Web IDE.
  2. Confirm that you are on the branch you just created by looking for the branch name in a dropdown in the top left corner of the page.
  3. In the left-hand file list, select README.md.
  4. On line 3 of the file, type Edit my README.md file
  5. Select Create commit…
  6. For Commit Message, type Updated the README.md file. Leave the radio box button at the default, so the commit will be made to the branch you created earlier.
  7. Select Commit.

D.Verify changes in a merge request

  1. Navigate to the merge request for the branch you just committed to.

    Hint: you can select the small link at the bottom of the page that shows an exclamation point and the MR number.

  2. On the merge request page, locate the Assignee section in the upper right-hand corner (you might have to select the double arrow at the top right of the screen to expand the pane). Ensure the merge request is assigned to yourself.
  3. Select the Changes tab directly below the merge request title.
  4. Hover over line 3 of the left side of the table (which contains the changes in your commit) and select the comment icon.
  5. In the comment field, type this is a comment and select Start a review. You’d normally add more comments to your review before submitting them all at once, but for this lab select Finish Review then Submit review to submit your single comment.
  6. Pretend that someone has seen your comment and added another commit to address it. Select Resolve thread to show that the comment has been dealt with.

E.Merge the branch and close the merge request

  1. To mark the merge request ready to merge, select the button to the right of Code in the upper right-hand corner and choose Mark as ready. This removes Draft: from your MR’s title.
  2. Select the Overview tab under the MR title.
  3. You haven’t specified any approvers for this project. If you had, an Approve button would appear in the View eligible approvers section.
  4. Ensure the Delete source branch checkbox is enabled, and select Merge.
  5. Navigate back to your project’s repository by selecting Repository in the left-hand navigation pane.
  6. Check what branch you’re on by looking at the dropdown at the top left of the page. Switch to main if you’re not already on it.
  7. Since the default view of the repository displays the contents of the README.md file, it’s easy to verify that the merge added Edit my README.md file to the contents of README.md.

Suggestions?

If you’d like to suggest changes to the Denomas with Git Basics Hands-on Guide, please submit them via merge request.

Last modified November 29, 2023: big update (17188382)