Author Topic: More Git troubleshooting  (Read 26951 times)

0 Members and 1 Guest are viewing this topic.

Offline jwood.ok

  • Newbie
  • *
  • Posts: 21
  • Last Login:June 09, 2024, 10:51:29 pm
More Git troubleshooting
« on: April 14, 2018, 09:18:04 pm »
Hey all, new user here.  I've done updates via email.  I've tried to do some through github, but Jim has let me know that apparently they always report a conflict.  Even so, I can take that same file from my repo and email it to him and it seems to work.

Initially, my process was entirely on the git hub website:
  • I created a fork of the main travelmapping / userdata files
  • In my own file on my fork, edit it with latest changes. 
  • Create a pull request, which I believe would sync it back up with the master branch.

Since then, I've now installed github desktop client on my computer, so now i'm working on local files, which is nice.  I've done quite a bit of work, so I've had a few times where I've committed.  I believe there is a push origin button, which looks like it has synced my file back up to my fork.  So I think we are good there.  But now what do I do to make sure this works and doesn't have conflicts?  If I log into my for, it says "This branch is 4 commits ahead, 41 commits behind TravelMapping:master."

Sorry for all the trouble.  The sad thing is, I'm an IT guy ...but I'm not a developer, still, you'd think I'd figure it out!  :D


Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4782
  • Last Login:Today at 01:08:33 pm
Re: More Git troubleshooting
« Reply #1 on: April 15, 2018, 04:27:06 am »
Initially, my process was entirely on the git hub website:

Please refer to this description: http://tm.teresco.org/forum/index.php?topic=2267.msg8175#msg8175

Since then, I've now installed github desktop client on my computer, so now i'm working on local files, which is nice.
But now what do I do to make sure this works and doesn't have conflicts?

  • First, you need to select the "UserData" repository on the left - I guess it's your only one.
  • You have to wait a few minutes till the "Update from TravelMapping/master" button on top is white on black instead of grey on black.
  • Then, press the "Update from TravelMapping/master" button!
  • Enter a summary on botton and press "Commit to master" button
  • Press "Sync" button on the right and wait a few seconds
  • Press "Pull request"
  • Enter a title (instead of "Master"), e.g. your user name or trip short description
  • Press "Send pull request"

You can edit your file just before "commit to master" or earlier. It doesn't matter.

I didn't "Update from TravelMapping/master" for a long time but sometimes I had conflicts like you. For that reason, I always wait till the damn button text color turns to white now.

Offline yakra

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4348
  • Last Login:Today at 05:55:57 pm
  • I like C++
Re: More Git troubleshooting
« Reply #2 on: April 15, 2018, 01:48:21 pm »
Quote
"This branch is 4 commits ahead, 41 commits behind TravelMapping:master."
I don't think this should be a problem. It just means that other people's list files are getting updated in the master branch, and their files have not been merged into yours, which you won't need to worry about.
Sri Syadasti Syadavaktavya Syadasti Syannasti Syadasti Cavaktavyasca Syadasti Syannasti Syadavatavyasca Syadasti Syannasti Syadavaktavyasca

Offline jwood.ok

  • Newbie
  • *
  • Posts: 21
  • Last Login:June 09, 2024, 10:51:29 pm
Re: More Git troubleshooting
« Reply #3 on: April 15, 2018, 11:58:13 pm »
Initially, my process was entirely on the git hub website:

Please refer to this description: http://tm.teresco.org/forum/index.php?topic=2267.msg8175#msg8175

Since then, I've now installed github desktop client on my computer, so now i'm working on local files, which is nice.
But now what do I do to make sure this works and doesn't have conflicts?

  • First, you need to select the "UserData" repository on the left - I guess it's your only one.
  • You have to wait a few minutes till the "Update from TravelMapping/master" button on top is white on black instead of grey on black.
  • Then, press the "Update from TravelMapping/master" button!
  • Enter a summary on botton and press "Commit to master" button
  • Press "Sync" button on the right and wait a few seconds
  • Press "Pull request"
  • Enter a title (instead of "Master"), e.g. your user name or trip short description
  • Press "Send pull request"

You can edit your file just before "commit to master" or earlier. It doesn't matter.

I didn't "Update from TravelMapping/master" for a long time but sometimes I had conflicts like you. For that reason, I always wait till the damn button text color turns to white now.

I'm not sure I'm understanding you.  In your instructions are you talking about from the website or from a a client.  I'm not seeing the "Update from TravelMapping/master" button

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4782
  • Last Login:Today at 01:08:33 pm
Re: More Git troubleshooting
« Reply #4 on: April 16, 2018, 02:15:48 pm »
I'm not sure I'm understanding you.  In your instructions are you talking about from the website or from a a client.  I'm not seeing the "Update from TravelMapping/master" button

I talk about the desktop client. "Update from TravelMapping/master" is "2"



« Last Edit: April 16, 2018, 02:19:34 pm by michih »

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4782
  • Last Login:Today at 01:08:33 pm
Re: More Git troubleshooting
« Reply #5 on: April 17, 2018, 02:05:51 pm »
I use GitHub Desktop 3.3.4.0. I've downloaded it from https://desktop.github.com/

However, only version 1.1.1 can be found now. I read "completely redesigned". I think there's an old and a new one?
I had a problem last December and had to re-installed GitHub Desktop. I found a totally different new version but couldn't get it running. Both have the same name: "GitHub Desktop".
I finally found the old installation at the link above and I still use the "old" one.

Is anyone using the "new" version 1.1.1 and can help jwood.ok? Or does anyone know where to find the "old" version?

Note: 3.3.4.0 is the old version, 1.1.1 is the new version :D

Offline wphiii

  • Newbie
  • *
  • Posts: 6
  • Last Login:January 08, 2020, 11:56:03 am
Re: More Git troubleshooting
« Reply #6 on: January 07, 2020, 02:41:17 pm »
Hi, apologies if this thread isn't intended for general troubleshooting, but it seems whatever I'm doing on GitHub is no longer actively reflecting to whatever .list file the Travel Mapping site is pulling from. I've been attempting to make my first update in several months over the past few days, and as far as I know I've done everything the same as I always have, except the only difference I'm noticing is that now there are two possible options when I go to commit changes to my .list file in the TM GitHub repository: one is "Commit directly to the MASTER branch," (which I don't believe was an option before) and the other is "Create a new branch for this commit and start a pull request." I have tried both, while waiting a full update cycle or two (per the timestamp in the log file on travelmapping.net), and neither option seems to be incorporating my most recent changes. Any advice would be hugely appreciated, thanks!

Offline oscar

  • TM Collaborator
  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 1576
  • Last Login:Today at 06:43:19 pm
    • Hot Springs and Highways pages
Re: More Git troubleshooting
« Reply #7 on: January 07, 2020, 03:02:00 pm »
One is "Commit directly to the MASTER branch," (which I don't believe was an option before) and the other is "Create a new branch for this commit and start a pull request." I have tried both, while waiting a full update cycle or two (per the timestamp in the log file on travelmapping.net), and neither option seems to be incorporating my most recent changes. Any advice would be hugely appreciated,

The second option is the right one. But it only starts a pull request. You then get a screen from which you can review and submit the pull request. As first, I sometimes forgot that second step.

Offline wphiii

  • Newbie
  • *
  • Posts: 6
  • Last Login:January 08, 2020, 11:56:03 am
Re: More Git troubleshooting
« Reply #8 on: January 07, 2020, 04:18:03 pm »
One is "Commit directly to the MASTER branch," (which I don't believe was an option before) and the other is "Create a new branch for this commit and start a pull request." I have tried both, while waiting a full update cycle or two (per the timestamp in the log file on travelmapping.net), and neither option seems to be incorporating my most recent changes. Any advice would be hugely appreciated,

The second option is the right one. But it only starts a pull request. You then get a screen from which you can review and submit the pull request. As first, I sometimes forgot that second step.

I'm positive I have been following through with submitting the pull request (at least, I have been doing it for 3-4 years now, so I'd be surprised if that were the issue, but it's certainly possible). I am noticing some more differences in the process, though, compared to what used to happen, so I'm hoping maybe someone can shed some light on which step(s) I'm getting wrong now:

First, on the initial file edit screen, it now asks me to name a "new branch" which, by default, consists of myusername-patch-x (where x is the sequential number of times I've tried this). Before, I believe it was just naming things "patch-x" so this may simply be an automatic change purely in nomenclature, but the inclusion of my username also makes me wonder if maybe my pull request is now going to a different place entirely that Jim or whoever can't see.




Then, I get to the create pull request screen, which looks familiar enough.




But THEN, on the final screen, I now have the option to merge the pull request myself? Which I don't remember ever having the capability of doing before. I may have gone ahead and done this on my first couple of attempts, because big green buttons are appetizing. Should I not be doing this? Does it make a difference?




For now, I'm not going to hit the big green button, since that appears to be the only decision tree option left that I don't think I've tried yet.

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4782
  • Last Login:Today at 01:08:33 pm
Re: More Git troubleshooting
« Reply #9 on: January 07, 2020, 04:27:19 pm »
The second option is the right one.

Maybe that's an option but the normal way is "Commit directly to the master branch", see manual: http://forum.travelmapping.net/index.php?topic=2267.msg8175#msg8175

Offline wphiii

  • Newbie
  • *
  • Posts: 6
  • Last Login:January 08, 2020, 11:56:03 am
Re: More Git troubleshooting
« Reply #10 on: January 07, 2020, 04:29:43 pm »
I think I may have figured something out - the repository linked from my GitHub front page is now apparently my own fork "wphackney/UserData" instead of the boss "TravelMapping/UserData" which I imagine it must have used to be, because I've always just gone directly in to whatever was linked on my home page and made my edits and it's always worked. So I think what I've been doing is essentially updating into my own void. Going to go into my .list from the actual TravelMapping repository and submit a pull request from there....


....and that looked exactly like it used to, so I think that was the problem.


Edit: and now the TravelMapping/UserData link is back on my front page, so I'm guessing what happened was enough time had lapsed since the last time I updated that it automatically removed itself from "my repositories."
« Last Edit: January 07, 2020, 04:33:27 pm by wphiii »

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4782
  • Last Login:Today at 01:08:33 pm
Re: More Git troubleshooting
« Reply #11 on: January 07, 2020, 04:32:08 pm »

Offline wphiii

  • Newbie
  • *
  • Posts: 6
  • Last Login:January 08, 2020, 11:56:03 am
Re: More Git troubleshooting
« Reply #12 on: January 07, 2020, 04:34:29 pm »
Yes, it's fine now: https://github.com/TravelMapping/UserData/pulls

The wrong pull request hangs here: https://github.com/wphackney/UserData/pulls

Great, thanks for the confirmation.

Mods, please feel free to delete these posts unless you think they'll be instructive in the future.

Offline cvoight

  • Newbie
  • *
  • Posts: 18
  • Last Login:September 03, 2021, 10:39:18 am
Re: More Git troubleshooting
« Reply #13 on: January 08, 2020, 10:16:44 pm »
The technical reason for this is due to the way GitHub tries to hide things behind the scenes for you to make the website easier to use. In order to make a change to a file in a git repository (such as the TravelMapping/UserData repository which contains everyone's list files), you need to have write access so that a commit can be made. Since Jim is the only(?) one with write access, when you use a web browser to edit a file in the TravelMapping/UserData repository, GitHub helpfully creates a fully updated branch (patch-n where n increments by one each time you edit your file) in your fork of the repository. Your fork is a complete copy of the repository under your username (wphackney/UserData here). The branches GitHub creates contain the complete & current history of the TravelMapping/UserData repository at the time they're created so that the branch is completely up-to-date and pull requests won't have conflicts*. For example, wphackney/UserData branch "patch-1" has the first 244 commits to TravelMapping/UserData, branch "patch-2" has the first 464 commits, and "patch-42" has the first 10,517 commits.



You have write access to your fork of the TravelMapping/UserData repository, so changes you seem to be making to the TravelMapping/UserData repository are actually being committed to these branches patch-n in your fork. When you finish this editing process and "propose file change" on the web, GitHub hides all the complicated stuff on the backend and automatically lets you submit a pull request of your patch-n branch back to the TravelMapping/UserData repository.



If instead of going to TravelMapping/UserData and editing your file there, you edit the file in your fork**, GitHub won't go through this process or may confuse you into creating a new branch in your fork that generates a pull request to your fork -- not TravelMapping/UserData. Doubly confusing if you aren't used to git and are used to editing from directly from the TravelMapping/UserData repository is that you will be making changes to an out-of-date branch in your fork due to the way GitHub structures branches. (The default branch GitHub shows you is "master" and GitHub created that the very first time you forked the repository -- being 4 years out of date in wphiii's case.)



So if you are using the web editor for everything, it's an easy mistake to make -- but luckily, easily fixable!

* this is actually (generally) not a problem for TravelMapping/UserData because multiple users don't / a single user from multiple computers doesn't edit a single file so there won't be conflicts -- but GitHub doesn't know this because the workflow is designed for software where multiple users might edit a single a file.

** to be clear -- this is a perfectly valid way to do it (see the manual michih linked to / wrote up) but since there are multiple ways to achieve the same objective with git / GitHub it's not the route wphiii and a few other users have chosen.
« Last Edit: January 08, 2020, 10:41:16 pm by cvoight »