Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusion about remote vs local #26

Open
aimran-adroll opened this issue Jul 28, 2022 · 1 comment
Open

Confusion about remote vs local #26

aimran-adroll opened this issue Jul 28, 2022 · 1 comment

Comments

@aimran-adroll
Copy link

Hi,

Thanks for the amazing tool.

I am a touch confused about how branches are labeled. Here is the following scenario

git checkout my_stuff
git rebase her_stuff
# ... conflict happened
vi readme.md 

I have noticed that if I run git rebase her_stuff instead of git merge her_stuff, the former marks the windows very differently. For example remote window ends up having my stuff whereas local shows her_stuff.

What is the optimal setup in this scenario? Or is this not the right tool for rebase type workflow?

@seankhl
Copy link

seankhl commented Nov 12, 2022

This is how rebases work. The remote corresponds to the branch you have checked out that you're placing on top of the branch you passed to the rebase command, i.e. that you're rebasing onto. So if your branch my_stuff and you're rebasing onto her_stuff, git does something like checks out her_stuff and then plays back the commits from my_stuff on top of it. As such, if a conflict happens, her_stuff looks like local and my_stuff looks like remote.

You can change your default layout to refer to "local" instead of "remote", and prefer revision to prefer "remote":

" In 'vimrc', set your default layout.
let g:mergetool_layout = 'ml'
let g:mergetool_prefer_revision = 'remote'

to get the behavior for rebasing to match what normally happens for merging. A while back I thought about trying to auto-detect rebase vs merge and set the appropriate thing in those cases, but I got lazy...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants