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 18.3k 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

      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
      • cruunnerrC Offline
        cruunnerr
        last edited by

        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

          @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 Reply Quote 0
          • mochmanM Offline
            mochman Module Developer
            last edited by mochman

            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 Reply Quote 2
            • N Offline
              ninjabreadman @PaulB
              last edited by ninjabreadman

              @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 Reply Quote 5
              • N Offline
                ninjabreadman @mochman
                last edited by

                @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

                  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.

                  MichMichM 1 Reply Last reply Reply Quote 0
                  • MichMichM Offline
                    MichMich @navyvette87
                    last edited by

                    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

                      @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
                      • strawberry 3.141S Offline
                        strawberry 3.141 Project Sponsor Module Developer
                        last edited by

                        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 Reply Quote 1
                        • N Offline
                          ninjabreadman @strawberry 3.141
                          last edited by

                          @e3v3a I take your point; in my case I’m running a reasonable size card and Raspbian/MM are all that is on the card. I do also mention to delete MM-Backup when they’re done. I really just wanted to give them the extra insurance of a full backup. Good call on tar, but they then need to know how to unpack it.

                          @strawberry-3.141 If you’re using git to stash changes, then you’ve clearly modified other files (IIRC, config.js and maybe custom.css are ignored). As above, I just wanted to give extra assurance that they had a full copy if anything went totally awry.

                          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 0
                          • D Offline
                            Dicous
                            last edited by

                            Hallo,

                            noob braucht hilfe =)

                            Wie kann ich bei dieser Fehlermeldung updaten?

                            
                            pi@raspberrypi:~ $ cd ~/MagicMirror && git pull
                            Aktualisiere 8010e62..60b9a5b
                            error: Your local changes to the following files would be overwritten by merge:
                                    modules/default/calendar/calendar.js
                                    modules/default/compliments/compliments.js
                            
                            
                            1 Reply Last reply Reply Quote 0
                            • F Offline
                              Frans @ninjabreadman
                              last edited by

                              @ninjabreadman - I tried to update accordingly your reply but i’m stranded. After git stash the system tells me

                              pi@magicpi:~/MagicMirror $ git stash
                              
                              *** Please tell me who you are.
                              
                              Run
                              
                                git config --global user.email "you@example.com"
                                git config --global user.name "Your Name"
                              
                              to set your account's default identity.
                              Omit --global to set the identity only in this repository.
                              
                              fatal: unable to auto-detect email address (got 'pi@magicpi.(none)')
                              Cannot save the current index state
                              

                              I don’t know how to react on this, you?

                              S 1 Reply Last reply Reply Quote 0
                              • S Offline
                                sdetweil @Frans
                                last edited by

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

                                git config --global user.email “you@example.com”
                                git config --global user.name “Your Name”

                                type those commands, add your email and name
                                git doesn’t allow anonymous actions

                                Sam

                                How to add modules

                                learning how to use browser developers window for css changes

                                F 1 Reply Last reply Reply Quote 1
                                • F Offline
                                  Frans @sdetweil
                                  last edited by

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

                                  git config --global user.name “Your Name”

                                  Worked!! Thanks!

                                  1 Reply Last reply Reply Quote 0
                                  • R Offline
                                    robiv8
                                    last edited by

                                    Und was soll uns das sagen?
                                    Any info about this error?

                                    pi@WEG-Infopanel:~/MagicMirror $ git stash
                                    package-lock.json: needs merge
                                    vendor/package-lock.json: needs merge
                                    package-lock.json: needs merge
                                    vendor/package-lock.json: needs merge
                                    package-lock.json: unmerged (928d17635a4aff632b96c3d78499948e24eb70be)
                                    package-lock.json: unmerged (1e84cc321d5ecb4199add46a08bfd7f3446d9c11)
                                    package-lock.json: unmerged (281f5adadabad8c0fa36c54a8b5c882b66e06722)
                                    vendor/package-lock.json: unmerged (a326b4026808f4b1ab060fe3c12e385f82330759)
                                    vendor/package-lock.json: unmerged (793948105835abe0d92caaf321cb78150cc983a4)
                                    vendor/package-lock.json: unmerged (9ad15ee58a9adce0f84708789296d2ae2ec1e029)
                                    fatal: git-write-tree: error building trees
                                    Kann den aktuellen Zustand des Index nicht speichern

                                    bheplerB 1 Reply Last reply Reply Quote 0
                                    • bheplerB Offline
                                      bhepler Module Developer @robiv8
                                      last edited by

                                      @robiv8 - You can delete those files and then do another git pull. So:

                                      cd ~/MagicMirror
                                      rm package-lock.json
                                      rm vendor/package-lock.json
                                      git pull
                                      npm install
                                      
                                      1 Reply Last reply Reply Quote 0
                                      • S Offline
                                        shazam23 @ninjabreadman
                                        last edited by

                                        @ninjabreadman I followed these steps and after running git stash apply I still get the “please commit changes” message…I’ve already backed up so unless the new update is thinking it also needs to be backed up I’m lost

                                        T 1 Reply Last reply Reply Quote 0
                                        • T Offline
                                          tcsabina @shazam23
                                          last edited by

                                          @shazam23
                                          You have modified files that has not been ‘saved’ in the git database. Type ‘git status’, and it will list those changes.
                                          After that you can decide what to do: keep the changes (in this case use ‘git commit’)
                                          revert or discard the changes (in this case ‘git checkout’ is the command, if I am not mistaken)

                                          Not sure what exactly you try to achieve, but for an update I would use a fresh directory instead. Just create a new one and clone into it…

                                          1 Reply Last reply Reply Quote 0

                                          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                          With your input, this post could be even better 💗

                                          Register Login
                                          • 1 / 1
                                          • 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