How to update the master branch?
I would like to know how to update the MagicMirror 2 setup. My current problem is following:
the software tells me that I am 251 commits behind the master branch.
Unfortunately updating everyhting did not work.
I updated it via following command:
“sudo apt-get update && apt-get upgrade”
Does someone has the same probem?
Many greetings from Hamburg :)
thats not how to update MM ;)
cd ~/MagicMirror && git pull
Keep in mind, that updating COULD result in issues with 3rd party modules, cause not all are up to date and some changes were made in MagicMirror. But in most cases it should be ok.
@cruunnerr thank you for your fast reply.
I ve tried to run it but unfortunately the console tells me to commit changes or to stash them before I can merge.
Unfortunately I have no clue what this means. Could you help me out? :)
Seems like you’ve changed some of the files in the MagicMirror directory. If you want to upgrade you’ll have to stash the changes. run
git stashin your MagicMirror directory, then run
git pull. Stashing wont affect your config.js or any modules you’ve installed into your modules directory.
@ninjabreadman’s has a better fix for you than I do.
@PaulB First, make a backup of your install with
cp -r ~/MagicMirror ~/MM-Backup. Then run
~/MagicMirrorto temporarily stash your changes so that
gitcan merge all those new commits.
To merge, run
git pullto update your MM install, then use
npm installto upgrade or install any new dependencies to the appropriate version.
Once complete, run
git stash applyto reintroduce your changes (while also keeping them in the stash) – you may need to deconflict or otherwise review these changes. You can see your changes with
Once you’re happy and MM is running smoothly, you can
git stash dropto get rid of the stash. You can run
rm -rf ~/MM-Backuponce you’re content it’s all working as it should.
Finally, I recommend you take the opportunity to also run
sudo apt-get update && sudo apt-get dist-upgrade npm && sudo dist-upgrade pm2(I think
nodejsshould upgrade as a dependency of
npmbut could be wrong).
@mochman Thanks! Sorry I subposted on you; I was writing on my phone (so didn’t see your post), plus Mobile Safari really hates the compose window of NodeBB, so it takes forever to post anything decent). That and autocorrect really hates
npm. Cheers. ;)