Is there a way to hard reset my repo to the upstream version without typing the branch name?

Viewed 22

What I'm looking for is a way to write

git reset --hard origin/teamname/issue-12345-some-branch-name

without all the redundancy if the thing I reset to is already set as the current upstream branch.

1 Answers

Try

git reset --hard @{u}

@{u} means the upstream branch for the current branch.

Related