Skip to content

How do I pull (with reset) a PR branch? #3617

Discussion options

You must be logged in to vote

While doing a hard reset onto your upstream works, it's not the recommended way to resolve this. The downside is that if you ever have the situation where the upstream was force-pushed, but you also have local commits that you didn't push yet (not at all an uncommon situation for me), the hard reset will blow away your local commits.

It's much better to rebase onto your upstream instead. You can do this manually by selecting your local branch and hitting u r.

However, I recommend to do git config --global pull.rebase true once, then every "git pull" will automatically do the rebase for you, and you never have to deal with this problem again.

(Side note: "origin/$(git rev-parse --abbrev-re…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@fredrikaverpil
Comment options

@fredrikaverpil
Comment options

Answer selected by fredrikaverpil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants