Skip to content

Commit 00cb404

Browse files
committed
[tooling] Add function to track remote branches
1 parent 1c66f0e commit 00cb404

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

exercise_utils/git.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,8 @@ def init(verbose: bool) -> None:
6868
def push(remote: str, branch: str, verbose: bool) -> None:
6969
"""Push the given branch on the remote."""
7070
run_command(["git", "push", remote, branch], verbose)
71+
72+
73+
def track_remote_branch(remote: str, branch: str, verbose: bool) -> None:
74+
"""Tracks a remote branch locally using the same name."""
75+
run_command(["git", "branch", branch, f"{remote}/{branch}"], verbose)

0 commit comments

Comments
 (0)