Github Merge Conflict

Posted on
  • I'm new to Github and not really sure what I'm doing. I'd hoped to make a couple of tweaks to the app that I'm developing tonight, but when I got to Github and attempted to do my usual "fetch upstream" to keep things up to date, it told me there was a conflict.

    I've poked around and tried to figure out what the problem was. I got to a point where I appear to need to download git and start using command-line instructions(!), which seems ridiculous as I've been using the GitHub web interface exclusively so far.

    My repo is at https://github.com/andrewgoz/BangleApps

    I suspect the problem is another app got added to the main apps.json, and that change conflicts with my addition. I've tried to manually edit my apps.json, but the conflict remains.

    I don't know what to do. Any advice would be appreciated.

  • I'm not sure I can actually see the conflict as I'm not logged in. Do you think you could post a screenshot of the page?

    Usually if someone commits something where there's a conflict I get to press a 'resolve conflict' button and worst case I see something like:

    ...
    >>>>>
    something here
    =======
    something else
    <<<<<
    

    And I have to delete the >>>>>>/========/<<<<<<<< and then figure out what should go in the middle based on the two conflicting items, then click the 'mark as resolved' button.

    In your case if someone added something new you probably want both bits in there, you just need to make sure that the brackets match.

    I imagine there are a whole bunch of tutorials on YouTube that'd explain it a lot better than I'm doing though

  • This is what I'm seeing:

    https://imgur.com/a/g2kBPrR

    The first image is my repo landing page and to date I've been clicking the "Fetch upstream" button. It normally "just works", but now it's showing "Open pull request" as shown.

    The second image is what I get when I click "Open pull request". Last night I tried to create a draft pull request (the "Update repo #1"), but I couldn't make sense of what I was seeing. I thought a draft request would be discarded, but it seems draft requests are quite permanent!

    For the third image I've just clicked on the "Files changed" tab. The fourth image is that page scrolled down a bit.

    I don't know if those help at all. I can't see anything that looks like a conflict??!! Everything just looks like typical everyday additions and deletions. I have no idea what it's complaining about.

  • Ahh - ok, so you created a pull request, and now you need to merge it...

    I took a look and I think the end of the finished file should look like:

      {
        "id": "qalarm",
        "name": "Q Alarm and Timer",
        "shortName": "Q Alarm",
        "icon": "app.png",
        "version": "0.02",
        "description": "Alarm and timer app with days of week and 'hard' option.",
        "tags": "tool,alarm,widget",
        "supports": ["BANGLEJS", "BANGLEJS2"],
        "storage": [
          { "name": "qalarm.app.js", "url": "app.js" },
          { "name": "qalarm.boot.js", "url": "boot.js" },
          { "name": "qalarm.js", "url": "qalarm.js" },
          { "name": "qalarmcheck.js", "url": "qalarmcheck.js" },
          { "name": "qalarm.img", "url": "app-icon.js", "evaluate": true },
          { "name": "qalarm.wid.js", "url": "widget.js" }
        ],
        "data": [{ "name": "qalarm.json" }]
      },
        "id": "emojuino",
        "name": "Emojuino",
        "shortName": "Emojuino",
        "version": "0.01",
        "description": "Emojis & Espruino: broadcast Unicode emojis via Bluetooth Low Energy.",
        "icon": "emojuino.png",
        "tags": "emoji",
        "supports" : [ "BANGLEJS2" ],  
        "readme": "README.md",
        "storage": [
          { "name": "emojuino.app.js", "url": "emojuino.js" },
          { "name": "emojuino.img", "url": "emojuino-icon.js", "evaluate": true }
        ]
      },
      {
        "id": "cliclockJS2Enhanced",
        "name": "Commandline-Clock JS2 Enhanced",
        "shortName": "CLI-Clock JS2",
        "version": "0.1",
        "description": "Simple CLI-Styled Clock with enhancements. Modes that are hard to use and unneded are removed (BPM, battery info, memory ect) credit to hughbarney for the original code and design",
        "icon": "app.png",
        "screenshots": [{"url":"screengrab.png"}],
        "type": "clock",
        "tags": "clock,cli,command,bash,shell",
        "supports": ["BANGLEJS","BANGLEJS2"],
        "allow_emulator": true,
        "storage": [
          {"name":"cliclockJS2Enhanced.app.js","ur­l":"app.js"},
          {"name":"cliclockJS2Enhanced.img","url":­"app.icon.js","evaluate":true}
        ]
    },
    {
        "id": "authentiwatch",
        "name": "2FA Authenticator",
        "shortName": "AuthWatch",
        "icon": "app.png",
        "screenshots": [{"url":"screenshot.png"}],
        "version": "0.01",
        "description": "Google Authenticator compatible tool.",
        "tags": "tool",
        "interface": "interface.html",
        "supports": ["BANGLEJS", "BANGLEJS2"],
        "readme": "README.md",
        "allow_emulator": true,
        "storage": [
          {"name":"authentiwatch.app.js","url":"ap­p.js"},
          {"name":"authentiwatch.img","url":"app-i­con.js","evaluate":true}
        ],
        "data": [{"name":"authentiwatch.json"}]
      }
    ]
    

    hope that helps!

  • Just a note that it's complaining about some things that don't appear on first glance to have changed - and it seems that whatever editor you used might have changed some 'whitespace' characters, which then confuses the merge

  • Thanks for your help - I do appreciate it!

    However, when I view the pull request ( https://github.com/andrewgoz/BangleApps/­pull/1 ), there is no "Resolve Conflicts". The bottom of the page looks like:

    https://imgur.com/a/8wl5mwH

    It appears I can't resolve this using the web interface! I tried clicking on "Use the command line" but I'm puzzled by the example commands referring to your repo and not mine.

    It's after midnight here now and I don't want to make things worse. I'll try again tomorrow night. Thanks again for your help.

  • Wow, that is a strange one - because when I look at that exact page I see this!

    Not sure what to suggest to be honest - but there must be a way to convince your GitHub login to offer a similar option


    1 Attachment

    • Screenshot at 2021-11-19 08-40-12.png
  • I was thinking about this at work today and realized that I was over-complicating things.

    While I couldn't see it in GitHub, the only possible conflict could have been the apps.json file, so when I got home tonight I manually copied the latest content from the espruino repo and copied it into mine (keeping a copy of my app entry in a text editor). That unlocked the "Fetch upstream" which completed, then I restored my app entry.

    Now I can do those tweaks I wanted to do two nights ago, and hopefully once I submit a pull request and get my entry into the main apps.json file, I won't have this problem again.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Github Merge Conflict

Posted by Avatar for andrewg_oz @andrewg_oz

Actions