Skip to content

Implement hp-remote-branch-pull#230

Merged
VikramGoyal23 merged 6 commits into
git-mastery:mainfrom
desmondwong1215:hp-remote-branch-pull
Jan 12, 2026
Merged

Implement hp-remote-branch-pull#230
VikramGoyal23 merged 6 commits into
git-mastery:mainfrom
desmondwong1215:hp-remote-branch-pull

Conversation

@desmondwong1215
Copy link
Copy Markdown
Contributor

@desmondwong1215 desmondwong1215 commented Jan 12, 2026

Exercise Review

Exercise Discussion

#187

Checklist

  • If you require a new remote repository on the Git-Mastery organization, have you created a request for it?
  • Have you written unit tests using repo-smith to validate the exercise grading scheme?
  • Have you tested your changes using the instructions posted?
  • Have you verified that this exercise does not already exist or is not currently in review?
  • Did you introduce a new grading mechanism that should belong to git-autograder?
  • Did you introduce a new dependency that should belong to app?

@github-actions
Copy link
Copy Markdown

Hi @desmondwong1215, thank you for your contribution! 🎉

This PR comes from your fork desmondwong1215/exercises on branch hp-remote-branch-pull.

Before you request for a review, please ensure that you have tested your changes locally!

Important

The previously recommended way of using ./test-download.py is no longer the best way to test your changes locally.

Please read the following instructions for the latest instructions.

Prerequisites

Ensure that you have the gitmastery app installed locally (instructions)

Testing steps

If you already have a local Git-Mastery root to test, you can skip the following step.

Create a Git-Mastery root locally:

gitmastery setup

Navigate into the Git-Mastery root (defaults to gitmastery-exercises/):

cd gitmastery-exercises/

Edit the .gitmastery.json configuration file. You need to set the following values under the exercises_source key.

{
    # other fields...
    "exercises_source": {
        "username": "desmondwong1215",
        "repository": "exercises",
        "branch": "hp-remote-branch-pull",
    }
}

Then, you can use the gitmastery app to download and verify your changes locally.

gitmastery download <your new change>
gitmastery verify

Checklist

  • (For exercises and hands-ons) I have verified that the downloading behavior works
  • (For exercises only) I have verified that the verification behavior is accurate

Important

To any reviewers of this pull request, please use the same instructions above to test the changes.

Copy link
Copy Markdown
Collaborator

@jovnc jovnc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this! Some changes are needed as I think there might be some issues with the issue itself.

],
verbose,
)
def fork_repo(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just merged a PR from @jiaxinnns that uses the same util function, you can rebase your PR against the main branch and use that instead.

Comment thread exercise_utils/git.py Outdated


def push(remote: str, branch: str, verbose: bool) -> None:
def push(remote: str, branch: str, verbose: bool, set_upstream: bool = False) -> None:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for this change, refer to below.

Comment thread hands_on/remote_branch_pull.py Outdated
add(["employees.txt"], verbose)
commit("Add Pam to employees.txt", verbose)

push("origin", "hiring", verbose, True)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to set upstream here. Seems like it was a mistake, as there's no need for git push -u

Below is the expected branches (no upstream here):
Image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the reason git push -u is used in the issue is because step 2 in the hands-on of T8L1 is git push origin -u hiring.

image

Should we just use git push origin hiring instead in this hands-on?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup that's right, we should use git push origin hiring instead so it won't set the upstream remote for us. This way, we can get the expected git branch -a output.

Copy link
Copy Markdown
Collaborator

@VikramGoyal23 VikramGoyal23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@VikramGoyal23 VikramGoyal23 merged commit f15adc8 into git-mastery:main Jan 12, 2026
4 checks passed
@desmondwong1215 desmondwong1215 deleted the hp-remote-branch-pull branch February 9, 2026 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Hands-On: remote-branch-pull] T8L2: Work with a branch that existed in the remote

3 participants