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.

    Contributing to a GitHub repository - a bit stuck

    Scheduled Pinned Locked Moved Solved Troubleshooting
    9 Posts 3 Posters 266 Views 3 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.
    • evroomE Offline
      evroom
      last edited by

      Hi,

      Trying to contribute to MMM-Hoymiles-Wifi, using GitHub.
      Sam gave me directions (thanks!), but of course this Noob cannot get it done.

      What I did so far:

      % git clone https://github.com/schris88/MMM-Hoymiles-Wifi
      
      % cd MMM-Hoymiles-Wifi
      
      % git branch
      * master
      
      % git checkout -b evroom
      Switched to a new branch 'evroom'
      
      % git branch
      * evroom
        master
      

      Updated README.md file.

      % git add README.md
      
      % git commit
      On branch evroom
      nothing to commit, working tree clean
      
      % git push
      fatal: The current branch evroom has no upstream branch.
      To push the current branch and set the remote as upstream, use
      
          git push --set-upstream origin evroom
      
      To have this happen automatically for branches without a tracking
      upstream, see 'push.autoSetupRemote' in 'git help config'.
      
      % git push --set-upstream origin evroom
      remote: Permission to schris88/MMM-Hoymiles-Wifi.git denied to evroom.
      fatal: unable to access 'https://github.com/schris88/MMM-Hoymiles-Wifi/': The requested URL returned error: 403
      

      Using an old Mac mini with macOS Sequoia Version 15.1.
      Develop with Visual Studio Code (that has Source Control too).

      Regards,

      E.J.

      MagicMirror version: 2.30.0
      Raspberry Pi 4 Model B Rev 1.5 (8 GB RAM)
      Raspbian GNU/Linux 12 (bookworm)

      Test environment:
      MagicMirror version: v2.30.0
      Raspberry Pi 3 Model B Plus Rev 1.3 (1 GB RAM)
      Raspbian GNU/Linux 12 (bookworm)

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

        @evroom said in Contributing to a GitHub repository - a bit stuck:

        git add README.md

        % git commit
        On branch evroom
        nothing to commit, working tree clean

        can you do
        git status

        it should show one file ‘staged’ to commit after your git add

        git commit should have a message to indicate WHAT/WHY this commit , so later someone looking for/thru commits might understand the intended changes
        (sorry I didn’t add that on the prior instructions)

         git commit -m "text of the message"   
        

        @evroom said in Contributing to a GitHub repository - a bit stuck:

        % git push
        fatal: The current branch evroom has no upstream branch.
        To push the current branch and set the remote as upstream, use

        git push --set-upstream origin evroom
        

        yes, the branch name is HERE but not THERE… so it wants explicit info how to link the two

        % git push --set-upstream origin evroom
        remote: Permission to schris88/MMM-Hoymiles-Wifi.git denied to evroom.
        fatal: unable to access ‘https://github.com/schris88/MMM-Hoymiles-Wifi/’: The requested URL returned error: 403

        yes, you are trying to push to HIS repo (and you don’t have write permission)
        this is why you use a fork so you can update as much as you want, cause YOU own it
        so you didn’t make a fork on github , and then clone THAT to your system

        easiest way to recover,

        • rename existing module folder name, with .orig
        • make fork on github (top right of his repo, push fork button)
        • clone yours in the MagicMirror/modules folder, go the folder, npm install if needed
        • git clone https://github.com/evroom/MMM-Hoymiles-Wifi
        • make a new branch (same name is ok)
        • copy files from the .orig to yours
        • then add/commit/push (to your fork) // same not found on github issue
        • then create a pull request to his repo, to PULL your changes from your fork into his repo
          (without having to give you write permission)

        once you are satisfied with the new repo (of fork) and copied files and retested
        then you can delete the clone of his repo (.orig)

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        evroomE 1 Reply Last reply Reply Quote 0
        • evroomE Offline
          evroom @sdetweil
          last edited by

          Sam,

          I think I ‘pulled’ it off.
          Thanks a lot for that.

          Now I am here:

          On https://github.com/schris88/MMM-Hoymiles-Wifi I now see:

          Pull requests: 1
          

          Click on ‘Pull requests’

          1 Open
          
          Major edit of README file.
          #5 opened 2 minutes ago by evroom
          

          Now it is up to Christian to approve this request, right ?
          What does he need to do ?
          And if he will give me write access, I can do this myself, right ?

          Of course I now need to make my changes to my repository, but would be nice how one completes this procedure.

          MagicMirror version: 2.30.0
          Raspberry Pi 4 Model B Rev 1.5 (8 GB RAM)
          Raspbian GNU/Linux 12 (bookworm)

          Test environment:
          MagicMirror version: v2.30.0
          Raspberry Pi 3 Model B Plus Rev 1.3 (1 GB RAM)
          Raspbian GNU/Linux 12 (bookworm)

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

            @evroom yes, as it sits this is up to him to MERGE your changes into his
            (this keeps people from stomping on others projects without warning)

            yes, if he makes you a collaborator on his project you can push directly,
            please try to use a separate branch still and merge when tested

            @evroom said in Contributing to a GitHub repository - a bit stuck:

            Of course I now need to make my changes to my repository, but would be nice how one completes this procedure.

            to make more changes, do the
            edit files on your system
            test
            add
            commit
            push

            now your repo is updated AND the PR is also updated (if he hasn’t merged yet)

            if he HAS merged, then you have sync your fork with his, (github button)
            git pull your fork to pc/pi, (already cloned, so just get updates)
            you can delete the old new branch
            git branch -D name
            git checkout -b new_branch_name

            use something different in this case, your REMOTE still have this old/prior branch
            (which you can delete on github)

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            evroomE 1 Reply Last reply Reply Quote 0
            • evroomE Offline
              evroom @sdetweil
              last edited by

              @sdetweil

              Great!

              Then a final question:

              In short:

              I program using in VS Code and here is Source Control active.
              Can I use the GitHub CLI and the Visual Studio Code like together, or will they bite each other ?

              A bit longer, with an example:

              I have edited HoymilesWifi.sh in VS Code.
              On my machine, I see:

              % git status
              On branch evroom
              Your branch is up to date with 'origin/evroom'.
              
              Changes not staged for commit:
                (use "git add <file>..." to update what will be committed)
                (use "git restore <file>..." to discard changes in working directory)
              	modified:   HoymilesWifi.sh
              
              no changes added to commit (use "git add" and/or "git commit -a")
              

              On VS Code I see:

              V Commit
              
              Changes
              
              $ HoymilesWifi.sh
              

              Can I Commit it from within VS Code, or is it safer to use the GitHub CLI as I have done for the README.md file previously ?

              MagicMirror version: 2.30.0
              Raspberry Pi 4 Model B Rev 1.5 (8 GB RAM)
              Raspbian GNU/Linux 12 (bookworm)

              Test environment:
              MagicMirror version: v2.30.0
              Raspberry Pi 3 Model B Plus Rev 1.3 (1 GB RAM)
              Raspbian GNU/Linux 12 (bookworm)

              S mumblebajM 2 Replies Last reply Reply Quote 0
              • S Offline
                sdetweil @evroom
                last edited by

                @evroom you can use VSCode to do the commit and push…

                I have not moved myself to that part of VSCode… (or let any IDE handle my commits etc)

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • mumblebajM Offline
                  mumblebaj Module Developer @evroom
                  last edited by

                  @evroom Just launch a terminal in VsCode

                  3fd31556-0ab9-43eb-926c-5eb33ee36d1c-image.png

                  Make sure it is set to bash.
                  62ee6f27-3f99-446c-b9fb-693c2f9285f6-image.png

                  Then you can run the same commands git add and git commit -m "your commit text" and git push from the terminal.

                  Check out my modules at: https://github.com/mumblebaj?tab=repositories

                  S evroomE 2 Replies Last reply Reply Quote 1
                  • S Offline
                    sdetweil @mumblebaj
                    last edited by

                    @mumblebaj yes, was trying not to add too much extra as there is already a terminal window open for running MM with the modified module

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    1 Reply Last reply Reply Quote 1
                    • evroomE Offline
                      evroom @mumblebaj
                      last edited by

                      @mumblebaj said in Contributing to a GitHub repository - a bit stuck:

                      Make sure it is set to bash.

                      It is set to zsh.
                      No issue to change it to bash, but is there a reasoning behind it ?

                      Stupidly enough I had this Terminal open the whole time.

                      I just did ‘Commit’ from within VS Code and then did ‘Sync Changes’.

                      Result:

                      % git status
                      On branch evroom
                      Your branch is up to date with 'origin/evroom'.
                      
                      nothing to commit, working tree clean
                      

                      So that works just fine.

                      I also made a change using the Terminal and then did the add and commit from the Terminal.
                      In the Source Control pane you can see what you do on the command line in real time.

                      MagicMirror version: 2.30.0
                      Raspberry Pi 4 Model B Rev 1.5 (8 GB RAM)
                      Raspbian GNU/Linux 12 (bookworm)

                      Test environment:
                      MagicMirror version: v2.30.0
                      Raspberry Pi 3 Model B Plus Rev 1.3 (1 GB RAM)
                      Raspbian GNU/Linux 12 (bookworm)

                      1 Reply Last reply Reply Quote 1
                      • evroomE evroom has marked this topic as solved on
                      • 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