• 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.

Backing up via GitHub repo

Scheduled Pinned Locked Moved Troubleshooting
19 Posts 6 Posters 3.3k Views 6 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.
  • S Offline
    sdetweil @arnedebeer
    last edited by May 21, 2020, 8:46 PM

    @arnedebeer well, there is a LOT of stuff on this machine… lots more than MM…

    Sam

    How to add modules

    learning how to use browser developers window for css changes

    1 Reply Last reply Reply Quote 0
    • A Offline
      arnedebeer @bhepler
      last edited by arnedebeer May 22, 2020, 12:32 PM May 22, 2020, 12:31 PM

      @bhepler I think you’re quite right to be honest. But by forking the entire project this won’t be possible, that’s why I was hoping it was possible to create a repo for it to automate the backup.

      Perhaps a better way to back my config up is to create a script that mails the config every x amount of time to myself :thinking_face: :thinking_face:

      B 1 Reply Last reply May 22, 2020, 4:24 PM Reply Quote 0
      • B Offline
        bhepler Module Developer @arnedebeer
        last edited by May 22, 2020, 4:24 PM

        @arnedebeer - If you must. I make it a practice that I back up the config.js just before I modify it. That way I don’t have a dozen identical copies of the file sitting around. It also lets me easily see when was the last time I changed the mirror.

        BitVise is good for this, as it will open a terminal window and an SCP window, which serves as a good reminder to copy the config file down before I do anything.

        1 Reply Last reply Reply Quote 0
        • K Offline
          karsten13
          last edited by May 22, 2020, 8:11 PM

          you can do that with a git repo which is located above your MagicMirror git repo.

          If you have a path structure e.g. ~/mm/MagicMirror where MagicMirror contains the MagicMirror-git-repo goto ~/mm and create a new git repo there with git init. Create a .gitignore file in ~/mm and put the line MagicMirror in it so this subdir is ignored.

          Now you can add files or directories with

          git add -f MagicMirror/config/config.js
          git add -f MagicMirror/modules/*
          

          Then commit.

          S 1 Reply Last reply May 24, 2020, 3:55 PM Reply Quote 0
          • S Offline
            sojourner
            last edited by May 24, 2020, 3:49 PM

            The MM repo has a git configuration to only track the “default” folder in the MM/modules folder. This is cool because you can have a separate git repository inside another! When you like a module someone (even yourself) created on github, you need to install it in the MM/modules folder. For example, from the MagicMirror/modules directory, I’m cloning a repo:

            [MagicMirror/modules]> git clone https://github.com/sdetweil/MyCovid19.git
            

            You’ll see that a new directory is created under the “modules” directory – and it’s the same name as the git repository. Important to this discussion; the MagicMirror repo doesn’t care about this new directory! You follow the usual steps to update MM with no git side-effects … and … you can update the new module directory that you cloned using the same “git pull” process!

            Side note: there are often a few more steps needed to install a module. In this example, @sdetweil follows best practice to include installation instructions in the module README.

            So, in a general case, you can create a repo, for example, “MyStuff” in the MM/modules folder. It can contain anything and you can manage it (edit files/push/pull/branch/etc.) all within the “MM/modules/MyStuff” directory.

            Just don’t call your repository “default”! :-b

            fyi - Git keeps track of files/directories to ignore within a repository by using a .gitignore file located in the repo’s root folder. Check out all the files the MagicMirror ignores!

            1 Reply Last reply Reply Quote 1
            • S Offline
              sojourner @karsten13
              last edited by May 24, 2020, 3:55 PM

              @karsten13 Git supports nested repositories. No need to create a higher level repo and then ignore the MagicMirror. There’s already a line in the MagicMirror/.gitignore

              # Ignore all modules except the default modules.
              /modules/**
              

              So anything can be created in the MagicMirror/modules directory – and it is ignored by the MM repo.

              1 Reply Last reply Reply Quote 0
              • K Offline
                karsten13
                last edited by May 24, 2020, 4:38 PM

                My answer is related toI was wondering how I could backup my config and modules folder to a private repository on GitHub.

                So if you want to put config and modules in one git repo without the other MagicMirror stuff, if found no other solution as doing it with such a “parent” construction as described …

                S 1 Reply Last reply May 24, 2020, 6:42 PM Reply Quote 0
                • S Offline
                  sojourner @karsten13
                  last edited by May 24, 2020, 6:42 PM

                  @karsten13 You are correct that a parent /mm/ repository could nicely include the MagicMirror/config/config.js file while excluding the ‘core’ MagicMirror! :clapping_hands_medium-light_skin_tone:

                  Minor thoughts:

                  1. Using your suggested command in that parent /mm/ repository,
                    git add -f MagicMirror/modules/*
                    
                    … will include the modules/default/ directory.
                    Since it is included by the MagicMirror repository. I suggest only adding the specific paths to any modules you have edited.
                  2. also add the .gitignore to the parent /mm/ repository.
                  1 Reply Last reply Reply Quote 0
                  • K Offline
                    karsten13
                    last edited by May 24, 2020, 8:36 PM

                    :thumbs_up:

                    1 Reply Last reply Reply Quote 0
                    • B Offline
                      BKeyport Module Developer
                      last edited by BKeyport May 25, 2020, 12:43 AM May 24, 2020, 11:50 PM

                      Here’s what I’ve done.

                      Everything I modify, including instructions for things that can’t be moved is stored in a “MyConfigs” directory on my harddrive, with symlinks in the original folder - so config.js and custom.css is actually symlinks in the magicmirror folders.

                      Modifications to modules that I do are all forked off the original and stored independently.

                      It took me literally 5 minutes to get config up again after a SD Card blowout…

                      Pros: no work to get unmodified modules and MagicMirror up to current.

                      Cons: remembering the dang symlink command. I’m gonna write a script.

                      The "E" in "Javascript" stands for "Easy"

                      1 Reply Last reply Reply Quote 1
                      • 1
                      • 2
                      • 2 / 2
                      2 / 2
                      • First post
                        13/19
                        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