Read the statement by Michael Teeuw here.
Merge conflict after update to 2.19
-
I think I need a little GitHub help.
Just updated from 2.18 to 2.19 using the updater script, and accepted the stashing of a couple of files (including package.json iirc) and then selected unstashing at the end.
But after reboot I just go to the Pi desktop rather than the mirror, and the logs have this in them:
npm ERR! code EJSONPARSE npm ERR! path /home/pi/MagicMirror/package.json npm ERR! Merge conflict detected in your package.json. npm ERR! npm ERR! Please resolve the package.json conflict and retry. npm ERR! A complete log of this run can be found in: npm ERR! /home/pi/.npm/_logs/2022-04-02T09_27_46_355Z-debug-0.log npm ERR! code EJSONPARSE npm ERR! path /home/pi/MagicMirror/package.json npm ERR! Merge conflict detected in your package.json. npm ERR! npm ERR! Please resolve the package.json conflict and retry. npm ERR! A complete log of this run can be found in: npm ERR! /home/pi/.npm/_logs/2022-04-02T09_27_48_900Z-debug-0.log npm ERR! code EJSONPARSE npm ERR! path /home/pi/MagicMirror/package.json npm ERR! Merge conflict detected in your package.json. npm ERR! npm ERR! Please resolve the package.json conflict and retry.
How do I resolve that conflict? If I try to move package.json away and git pull I get
error: Pulling is not possible because you have unmerged files. hint: Fix them up in the work tree, and then use 'git add/rm <file>' hint: as appropriate to mark resolution and make a commit. fatal: Exiting because of an unresolved conflict.
My GitHub-fu is not strong enough to know how to resolve this one. Can someone assist in what commands I need?
The git stash is
fonts/package-lock.json | 26 - modules/default/weatherforecast/weatherforecast.js | 2 +- package-lock.json | 15293 ------------------------------------------------------------------------------------------------ package.json | 1 + vendor/package-lock.json | 154 - 5 files changed, 2 insertions(+), 15474 deletions(-)
-
OK did some searching and some reading of GitHub documentation and have resolved it. Used “Git Status” and the command options given therein.
Now just have to up the update for the default modules due to the depreciations
-
@DarrenHill rule 1. NEVER change the mm supplied source.
you can do all the config thru the config.js.
-
@sdetweil Yes, I’m not quite sure what the weatherforecast.js change was, but that’s blown away now. As you say, the new module is fine with a little tweaking via custom.css.
It was the package.json file that screwed things up, and that I know I have never touched and have no idea what it was and why it got out of sync.
Anyway I learned a bit of stuff about GitHub and stashing, so that’s a bonus and we’re up and running again fine (after swapping out the depreciated weather modules too).
-
@DarrenHill
thegit diff x
command
will show you the changesx is an optional file name.
if not supplied, it will show all changes to all changes filesgit status will show you if any files are changed
-
@sdetweil Good to know.
git status got me out of it, as I think things got out of sync rather than really needing merging or proper tracking (if subsequent research on what package.json actually means and does).
But useful to know how to actually see the differences for future reference. I really need to get more skilled-up on GitHub, but it always defeats me as I’m only an occasional hobby programmer for personal usage rather than for sharing/collaboration.
-
also
git checkout filename
will restore a file to it’s repo contents.
-
@DarrenHill git is the thing
gitHUB is just server for holding code, and accepting changes (pull requests) from others