Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions hands_on/fetch_merge.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import os

from exercise_utils.cli import run_command
from exercise_utils.git import clone_repo_with_git

__requires_git__ = True
__requires_github__ = False


def download(verbose: bool):
clone_repo_with_git(
"https://github.com/git-mastery/samplerepo-finances.git", verbose
)
os.chdir("samplerepo-finances")
run_command(
Copy link
Contributor

@jovnc jovnc Dec 6, 2025

Choose a reason for hiding this comment

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

You can use this instead from exercise_utils.git

remove_remote("origin", verbose)
add_remote("origin", "https://github.com/git-mastery/samplerepo-finances-2", verbose)

This is equivalent to a set-url. Alternatively, you can create a new utility to do this under exercise-utils but that may be unnecessary.

This is a similar merged PR #116

["git", "remote", "set-url", "origin", "https://github.com/se-edu/samplerepo-finances-2.git"], verbose
)