FHIR Chat · Git Pull - aborts because loinc.xml & snomed.xml ?changes? · committers/git-help

Stream: committers/git-help

Topic: Git Pull - aborts because loinc.xml & snomed.xml ?changes?


view this post on Zulip John Moehrke (Oct 13 2018 at 13:41):

I had a successful build update weeks ago. I now go to get everything again to do a new branch. Starting with Git Pull as instructions indicate. This aborts ....

error: Your local changes to the following files would be overwritten by merge:
source/loinc/loinc.xml
source/snomed/snomed.xml
Please commit your changes or stash them before you merge.
Aborting

view this post on Zulip John Moehrke (Oct 13 2018 at 13:42):

I have not changed these files!

view this post on Zulip John Moehrke (Oct 13 2018 at 13:44):

A Git diff tells me there are no differences except for Newlines
pasted image

view this post on Zulip John Moehrke (Oct 13 2018 at 13:44):

Help? What do I do?

view this post on Zulip John Moehrke (Oct 13 2018 at 13:46):

is there a way to abandon my local copy completely? In the SVN days when strange things would happen I would delete the whole fhir directory and pull everything.. can I do that with GIT?

view this post on Zulip Josh Mandel (Oct 13 2018 at 13:47):

Your can. But it would be good to know a by more about that's going on.

view this post on Zulip Josh Mandel (Oct 13 2018 at 13:48):

What branch are you on?

view this post on Zulip John Moehrke (Oct 13 2018 at 13:48):

my local?

view this post on Zulip John Moehrke (Oct 13 2018 at 13:49):

I am doing fhir core.. not an IG

view this post on Zulip Josh Mandel (Oct 13 2018 at 13:49):

So think that's what clone you're using (a local clone of the fhir repo). Within that, you use branches, for specific features

view this post on Zulip Josh Mandel (Oct 13 2018 at 13:50):

Are you currently on the master branch and doing a "pull" when you hit this error?

view this post on Zulip John Moehrke (Oct 13 2018 at 13:52):

I am trying to figure out your question so that I can give the right answer... sorry, but the new vocabulary of GIT is a struggle

view this post on Zulip Josh Mandel (Oct 13 2018 at 13:52):

no worries

view this post on Zulip John Moehrke (Oct 13 2018 at 13:52):

back on 9/8/2018 I did a branch to do a typo in Consent, I did this mostly just to test that I could read the GIT directions. -- #20

view this post on Zulip Josh Mandel (Oct 13 2018 at 13:52):

I'd like to know what "git branch" and "git status" tell you.

view this post on Zulip John Moehrke (Oct 13 2018 at 13:53):

I completed that work then... and nothing has been done since

view this post on Zulip Josh Mandel (Oct 13 2018 at 13:53):

Okay, so you might not have switched back to the master branch?

view this post on Zulip John Moehrke (Oct 13 2018 at 13:54):

I didn't know that was a step. I followed the wiki article on GIT FHIR

view this post on Zulip John Moehrke (Oct 13 2018 at 13:54):

I completed all steps

view this post on Zulip Josh Mandel (Oct 13 2018 at 13:54):

Ok. "Switch back to master" is s step

view this post on Zulip John Moehrke (Oct 13 2018 at 13:55):

a git branch says johnmoehrke-cbcp-qa

view this post on Zulip Josh Mandel (Oct 13 2018 at 13:55):

But it's important for you to know what branch you're on at any given time.

view this post on Zulip Josh Mandel (Oct 13 2018 at 13:55):

Ah, okay -- so it looks like you did not switch back to master perhaps. Or at least not successfully.

view this post on Zulip Josh Mandel (Oct 13 2018 at 13:56):

Was this the branch for your old fix from a couple of weeks ago?

view this post on Zulip John Moehrke (Oct 13 2018 at 13:56):

yes last month

view this post on Zulip Josh Mandel (Oct 13 2018 at 13:56):

Okay, so go back to the instructions and see if you can follow that last step about switching back to master.

view this post on Zulip John Moehrke (Oct 13 2018 at 13:56):

okay

view this post on Zulip Josh Mandel (Oct 13 2018 at 13:57):

https://github.com/HL7/fhir/wiki/Using-TortoiseGit-with-FHIR#switch-back-to-master

view this post on Zulip John Moehrke (Oct 13 2018 at 13:58):

okay. done

view this post on Zulip John Moehrke (Oct 13 2018 at 13:59):

what is the next step, now that I want to start a new set of changes?

view this post on Zulip John Moehrke (Oct 13 2018 at 14:00):

do I start at the top with Git Pull? -- if so, it is still failing the same way.

view this post on Zulip Josh Mandel (Oct 13 2018 at 14:04):

Okay -- at least that progress.

view this post on Zulip John Moehrke (Oct 13 2018 at 14:04):

Note that last step to switch back to master is not on the original article https://github.com/HL7/fhir/wiki/Get-Started-with-FHIR-on-GitHub

view this post on Zulip John Moehrke (Oct 13 2018 at 14:04):

the original article is all that existed when I did this branch last month

view this post on Zulip Josh Mandel (Oct 13 2018 at 14:04):

At this stage if you really don't have any changes to those files that you know about her care about you can always delete them or do "git checkout path/to/files"

view this post on Zulip Josh Mandel (Oct 13 2018 at 14:05):

Okay. The original article starts off with a git checkout master, and it looks like the tortoise article puts that's at the end :-)

view this post on Zulip John Moehrke (Oct 13 2018 at 14:05):

How can I submit a note on that github wiki page?

view this post on Zulip Josh Mandel (Oct 13 2018 at 14:06):

But either way I think you've done this stuff if git status currently tells you "master"?

view this post on Zulip Josh Mandel (Oct 13 2018 at 14:06):

There is an edit button at the top of the page.

view this post on Zulip Josh Mandel (Oct 13 2018 at 14:06):

We will eventually move this to Confluence once things are set up there properly.

view this post on Zulip Josh Mandel (Oct 13 2018 at 14:06):

@Lloyd McKenzie

view this post on Zulip Josh Mandel (Oct 13 2018 at 14:06):

So "git status" tells you master now?

view this post on Zulip John Moehrke (Oct 13 2018 at 14:06):

hm, I figured I could do some kind of a pull request on the wiki article indicateing an improvement opportunity

view this post on Zulip Josh Mandel (Oct 13 2018 at 14:07):

Not a feature of GitHub wikis

view this post on Zulip John Moehrke (Oct 13 2018 at 14:09):

yes git status
C:\Users\john.moehrke\Documents\GitHub\fhir>git status
On branch master
Your branch is behind 'origin/master' by 187 commits, and can be fast-forwarded.

(use "git pull" to update your local branch)

Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)

    deleted:    vscache/0078.cache
    deleted:    vscache/administrative-gender.cache
    deleted:    vscache/cvx.cache

.........

view this post on Zulip Josh Mandel (Oct 13 2018 at 14:10):

And git pull fails?

view this post on Zulip John Moehrke (Oct 13 2018 at 14:10):

How do I do a git status from tortoises Git?

view this post on Zulip John Moehrke (Oct 13 2018 at 14:11):

tortoise Git fails... yes

view this post on Zulip John Moehrke (Oct 13 2018 at 14:11):

I can try commandline if you guide me

view this post on Zulip Josh Mandel (Oct 13 2018 at 14:11):

And on the CLI does "git pull" work or fail? I assume they should be identical but I'm not familiar with tortoise so it could be worth trying this.

view this post on Zulip John Moehrke (Oct 13 2018 at 14:12):

C:\Users\john.moehrke\Documents\GitHub\fhir>git pull
error: Your local changes to the following files would be overwritten by merge:
source/loinc/loinc.xml
source/snomed/snomed.xml
Please commit your changes or stash them before you merge.
Aborting
Updating 16402e4ca9..c088f817f2

view this post on Zulip Josh Mandel (Oct 13 2018 at 14:13):

Okay. If you really don't think you have any changes to this directory you can do "git checkout source"

view this post on Zulip Josh Mandel (Oct 13 2018 at 14:13):

And see if that helps.

view this post on Zulip Josh Mandel (Oct 13 2018 at 14:13):

Otherwise you can also just delete the two files as you suggested.

view this post on Zulip John Moehrke (Oct 13 2018 at 14:13):

if I delete them, how do I make sure that GIT doesn't think I want them deleted on master?

view this post on Zulip John Moehrke (Oct 13 2018 at 14:14):

I know I have not made any changes.. and git diff says so (see screen shot above)

view this post on Zulip Josh Mandel (Oct 13 2018 at 14:15):

You'd have to stage a deletion with "git rm" to tell git you want to commit that change.

view this post on Zulip John Moehrke (Oct 13 2018 at 14:15):

seems git checkout source is what I should do

view this post on Zulip Josh Mandel (Oct 13 2018 at 14:15):

Either is fine, yes

view this post on Zulip Josh Mandel (Oct 13 2018 at 14:16):

It looks like the root cause of the error John is seeing relates to line endings. Does anyone know how tortoise is configured to handle Linux vs Windows line endings by default?

view this post on Zulip John Moehrke (Oct 13 2018 at 14:17):

yes that seems to be the issue. yet I never edited these, so at somepoint someone switched from one to the other. I am happy to just use theirs

view this post on Zulip John Moehrke (Oct 13 2018 at 14:18):

so guide me.. is there a tortoise way to do this? What exactly is the commandline?

view this post on Zulip Josh Mandel (Oct 13 2018 at 14:20):

Just delete the files or "git checkout source" on the CLI for now, or you can probably right click on the source directory and choose something's like "checkout" from the tortoise context menu. (I don't know how to prevent this from happening again on Windows so I'm hoping others will weigh in here.)

view this post on Zulip John Moehrke (Oct 13 2018 at 14:22):

I have tried a checkout in tortoise with same results

view this post on Zulip John Moehrke (Oct 13 2018 at 14:22):

I try a commandline 'git checkout source' and it seems okay, nothing outputted

view this post on Zulip John Moehrke (Oct 13 2018 at 14:23):

commandline git pull seems to have worked

view this post on Zulip John Moehrke (Oct 13 2018 at 14:24):

so might be a tortoise bug?

view this post on Zulip Josh Mandel (Oct 13 2018 at 14:25):

@all has anyone else run into this?

view this post on Zulip Lloyd McKenzie (Oct 13 2018 at 14:30):

I've had an issue with end-of-line changes in the terminology files. I think it's a build problem, not a Git problem though. The build should not be using the end-of-line convention of the local build environment for files that are being committed - it should always use a standard convention (don't really care if that's Windows or Unix). No human's edit these files - they're created automatically by the build process, so we should never get a conflict due to line endings. (Though we will also get conflicts due to changed metadata such as the generation date - it would be nice if we could make that go away too...)

view this post on Zulip Lloyd McKenzie (Oct 13 2018 at 14:31):

However, I haven't had John's specific issue (yet). When I got a conflict, I could see the files in my list of files when I wanted to commit and I was able to revert them.

view this post on Zulip Rob Hausam (Oct 13 2018 at 14:38):

I've seen unexpected changes, particularly in the terminology cache files - that could be the reason.

view this post on Zulip Grahame Grieve (Oct 13 2018 at 19:14):

the build will always use unix style line endings for snomed.xml and loinc.xml

view this post on Zulip Joel Schneider (Oct 15 2018 at 17:06):

This may be of interest:
https://help.github.com/articles/dealing-with-line-endings/

view this post on Zulip Michelle (Moseman) Miller (Oct 30 2018 at 13:22):

I see this all the time. It usually occurs after I switch back to master and try to pull. To workaround it, I revert, then re-pull.


Last updated: Apr 12 2022 at 19:14 UTC