Skip to content

Commit 09e256f

Browse files
authored
Merge branch 'warpdotdev:main' into main
2 parents e56d3eb + 01f7d91 commit 09e256f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

specs/git/reset_local_branch_to_match_remote_branch.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
---
22
name: Reset local branch to match remote branch
3-
command: "git fetch origin\ngit reset --hard {{branch}}"
3+
command: "git fetch {{remote}}\ngit reset --hard {{remote}}/{{branch}}"
44
tags:
55
- git
66
description: Resets a local branch to match a remote branch by pulling the most recent changes from the remote branch and then force resetting the local branch to match the remote branch.
77
arguments:
8+
- name: remote
9+
description: The name of the remote
10+
default_value: origin
811
- name: branch
912
description: The name of the remote branch that the local branch should be reset to
10-
default_value: origin/master
13+
default_value: master
1114
source_url: "https://stackoverflow.com/questions/1628088/reset-local-repository-branch-to-be-just-like-remote-repository-head"
1215
author: Dan Moulding
1316
author_url: "https://stackoverflow.com/users/95706/dan-moulding"

0 commit comments

Comments
 (0)