• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

How to update the master branch?

Scheduled Pinned Locked Moved Troubleshooting
19 Posts 15 Posters 15.2k Views 12 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    PaulB
    last edited by Jan 28, 2018, 11:24 AM

    Dear fellows,

    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 :)

    1 Reply Last reply Reply Quote 0
    • C Offline
      cruunnerr
      last edited by Jan 28, 2018, 11:49 AM

      thats not how to update MM ;)

      try this:

      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.

      1 Reply Last reply Reply Quote 0
      • P Offline
        PaulB
        last edited by Jan 28, 2018, 2:08 PM

        @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? :)

        N 1 Reply Last reply Jan 28, 2018, 2:35 PM Reply Quote 0
        • M Offline
          mochman Module Developer
          last edited by mochman Jan 28, 2018, 2:41 PM Jan 28, 2018, 2:33 PM

          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 stash in your MagicMirror directory, then run git pull. Stashing wont affect your config.js or any modules you’ve installed into your modules directory.

          Edit
          @ninjabreadman’s has a better fix for you than I do.

          N 1 Reply Last reply Jan 28, 2018, 4:08 PM Reply Quote 2
          • N Offline
            ninjabreadman @PaulB
            last edited by ninjabreadman Jan 28, 2018, 3:09 PM Jan 28, 2018, 2:35 PM

            @PaulB First, make a backup of your install with cp -r ~/MagicMirror ~/MM-Backup. Then run git stash in ~/MagicMirror to temporarily stash your changes so that git can merge all those new commits.

            To merge, run git pull to update your MM install, then use npm install to upgrade or install any new dependencies to the appropriate version.

            Once complete, run git stash apply to 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 git diff.

            Once you’re happy and MM is running smoothly, you can git stash drop to get rid of the stash. You can run rm -rf ~/MM-Backup once 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 nodejs should upgrade as a dependency of npm but could be wrong).

            Problem with config or JavaScript? Copy/paste it into JSHint.
            Check out the detailed walkthroughs on install, config, modules, etc.

            E F S 3 Replies Last reply Apr 4, 2018, 3:43 AM Reply Quote 5
            • N Offline
              ninjabreadman @mochman
              last edited by Jan 28, 2018, 4:08 PM

              @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 git and npm. Cheers. ;)

              Problem with config or JavaScript? Copy/paste it into JSHint.
              Check out the detailed walkthroughs on install, config, modules, etc.

              1 Reply Last reply Reply Quote 2
              • N Offline
                navyvette87
                last edited by Apr 3, 2018, 8:08 AM

                Thanks guys, I have one more to upgrade. And figure out why MMM-Traffic won’t upgrade, but I think you way around would help that to.

                M 1 Reply Last reply Apr 3, 2018, 9:46 AM Reply Quote 0
                • M Offline
                  MichMich Admin @navyvette87
                  last edited by Apr 3, 2018, 9:46 AM

                  cd ~/MagicMirror/modules/MMM-Traffic
                  git pull
                  

                  Restart your MagicMirror and you should be good to go. ;)

                  1 Reply Last reply Reply Quote 1
                  • E Offline
                    E3V3A @ninjabreadman
                    last edited by Apr 4, 2018, 3:43 AM

                    @ninjabreadman said in How to update the master branch?:

                    @PaulB First, make a backup of your install with cp -r ~/MagicMirror ~/MM-Backup.

                    Noo! Not a good idea if you’re running on a RPi with small SD card. That is a huge directory: du -sh ./ ~1.3GB, already for a quite small install. You might need that space for the update itself. Never good idea to max out your SD card.

                    Rather use tar, and try one of these:

                    cd ~
                    # remove `v` flag to avoid huge verbose output
                    tar --exclude={.git,node_modules} -zcvf MM_BAK.tgz ./MagicMirror
                    tar --exclude='node_modules' --exclude='.git' -zcvf MM_BAK.tgz ./MagicMirror
                    
                    # This may require you to have the bash shell option globstar' set.
                    # Check with: 'shopt -s globstar'
                    tar --exclude='**/.git/*' --exclude='**/node_modules/*' -zcvf MM_BAK.tgz ./MagicMirror
                    

                    This will avoid getting the huge node_modules and .git directories.
                    (You can always git init and reset your git origin url to git fetch from the resp directories if needed to re-instate.)

                    "Everything I do (here) is for free – altruism is the way!"
                    MMM-FlightsAbove, MMM-Tabulator, MMM-Assistant (co-maintainer)

                    1 Reply Last reply Reply Quote 0
                    • S Offline
                      strawberry 3.141 Project Sponsor Module Developer
                      last edited by Apr 4, 2018, 6:16 AM

                      if you are using mm as supposed to you only need to backup the config.js and custom.css

                      Please create a github issue if you need help, so I can keep track

                      N 1 Reply Last reply Apr 4, 2018, 11:02 AM Reply Quote 1
                      • 1
                      • 2
                      • 1 / 2
                      • First post
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Sam, technical setup by Karsten.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy