fork-dev / Tracker

Bug and issue tracker for Fork for Mac
494 stars 12 forks source link

Support resetting a local branch to match the remote tracking branch #2047

Closed cdwilson closed 4 months ago

cdwilson commented 5 months ago

Sometimes I'll checkout a branch locally that is later rebased by someone else on the remote (for example, to try out a colleague's WIP branch). I'd like to have an easy way to update my local branch to match the remote tracking branch.

It would be nice to be able to right click on a local branch and just select something like Reset to 'origin/branch-name' (i.e. do the equivalent of git reset @{u}, maybe with the option to do git reset --hard @{u}).

DanPristupov commented 5 months ago

I'd like to have an easy way to update my local branch to match the remote tracking branch. It would be nice to be able to right click on a local branch and just select something like ...

Right click on a local branch and select 'Fast-forward'.

cdwilson commented 4 months ago

Right click on a local branch and select 'Fast-forward'.

@DanPristupov Sorry, I realized it wasn't clear what I was asking previously.

Is there a way to do this for non-fast-forward updates? I'm specifically looking for a way to easily handle the non-fast-forward case, but when I right click on the branch and select "Fast-forward" I get this error:

image

Currently, I have been switching over to the command line to run the following in this case:

git checkout <branch>
git reset --hard @{u}