-
Notifications
You must be signed in to change notification settings - Fork 501
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
Explain merge #3279
Comments
The following tutorial is reasonable but not entirely useful for Chezmoi does not have four panes (the "merge result" on the bottom, usually), only three (it does not have the
You are viewing a simultaneous diff with all three versions. The one where you need to make changes is the middle one ( You can navigate diffs ( You can pull changes from a buffer to the source by being in buffer 2 (Source) and doing Sometimes, and this is especially true with templates, you will need to manually edit the Source template — especially if it's a template formatting error (you forgot a By setting the I don’t use emacs, but you should be able to configure it as the merge command (the following links are for git merge tool &c., but it would be similar for
@benmezger has written some tooling to help use chezmoi with emacs: https://seds.nl/notes/chezmoi-and-emacs/; he may be able to provide more help on that. (There is also https://github.com/tuh8888/chezmoi.el.) Here is a video on 3-way merges — but be warned that it's basically the first video on such I found via DDG: https://www.youtube.com/watch?v=OYhAG-_PY6I I don’t see us adding this to chezmoi documentation, but I will leave this open to see if (a) what I have provided helps and (b) if anyone else can provide more specific assistance. |
Thank you for a very kind and complete answer @halostatue. @philippludwig please re-open this issue if you have further questions. |
Everything is clear now, thanks @halostatue. |
What exactly are you trying to do?
Merge a file that has been edited on two machines.
What have you tried so far?
chezmoi merge
Where else have you checked for solutions?
Output of any commands you've tried with
--verbose
flagOutput of
chezmoi doctor
Additional context
So "now" (since 2019 it seems)
chezmoi merge
is here and I tried to merge my.emacs
file that I modified on machine A, pushed and then modified on machine B before pulling there. Silly me, I know.Therefore I ran
chezmoi merge
, thenvimdiff
opens and I have no clue what to do. Consulting the chezmoi user guide does not help, it just states that I could use other tools, but I don’t know which are easier. I know my way around Vim, so I tried the vimdiff integrated help, but that did not clear things up. I also have a really hard time to wrap my head around "destination"/"target"/"source", what does that even mean? I was expecting a "normal" git-like merge, i.e. when I pull some repository and have a merge conflict.I have been using git for 10 years, but never had to do a 3-way merge. I usually get away by running
git stash
,git pull
,git stash pop
and then resolve the conflicts manually, which is something I would like to do here.Since I could not find any satisfying tutorial to vimdiff online, I just tried something and of course it destroyed my file completely.
So here is my request: Could there be some noob-friendly explanation on how to use
merge
in the user guide? Or a stash feature?Because right now, all I want to do is have the changes in my
~/.emacs
file that I made on both machines.The text was updated successfully, but these errors were encountered: