Sorry, deze pagina is niet beschikbaar in het Nederlands.

Git it?

To assist in the development of the JMRI Java application for running trains, I signed on to GitHub and installed GitHub Desktop. I figured out how to clone the original JMRI repository to my own GitHub remote repo. Creating a Branch to write new or improved code for web pages and configuration files on GitHub web was next.

Then came the step to clone my remote repo to a local copy on my computer. GitHub Desktop looked like a perfect program to do this. So now I had a large folder on my desktop with a copy of my repo, letting me edit any file directly from the Finder in either Espresso or an image editing app. You need this local repo 1 to delete and add files anyway.

my Git Setup

Diagram of remote and local files

But when I added the Netbeans IDE there was a mix-up in the source and target files. You save on disk space by pointing NetBeans to local GitHub repo 1 as its Git master. But a Commit + Push in NetBeans shows up like the exact opposite in GitHub Desktop: when I added a word in NB, GitHub Desktop showed that Commit as deleting that word from the files it was comparing. That setup with one index won’t work!

So I suggest you let both Git clients clone the same remote repo. And only edit in repo 2 inside NetBeans, not at a file level. Added benefit: this looks exactly the same when you work on 2 computers, with your remote GitHub repo as the one and only central place from which to make Pull Requests.

Oops, a conflict?!

Whatever your workflow looks like, when you make a commit or update a branch from the current upstream master, GitHub may signal a conflict which you have to solve. GitHub Web marks “a conflict” but doesn’t tell you what or why. Open GitHub Desktop to solve a conflict: scroll through the list to find the problematic file. To the right look for the »»»> mark(s). Right click and select “Show in Finder” and open the file with your favorite editor. Choose which part to retain and what to delete. Delete the »> lines, Save and return to GitHub Desktop. Choose Commit to [your branch], and Sync with your remote repo. You’re ready to merge the Pull Request.

Happy Gitting!




Verder lezen?

Deze stukjes zijn misschien ook interessant:

  • Engelse wissel op een JMRI Control Panel
  • Bouw een slimme ventilator-besturing
  • Bouw zelf een AGA Display
  • Allerlei
  • Website is verhuisd