git pull isn't pulling

git pull isn't pulling

by Garth Brady -
Number of replies: 9

So, I installed Moodle using Moosh/git.  Now when I got to perform a git pull, I get:

error: Your local changes to the following files would be overwritten by merge:

And then a thousand files/folders are listed in everything from admin/environment to course/* and enrol/* to  reportuilder/upgrade.txt...  files/folders I've not touched in any way (at least that I'm aware of...  it's a pretty stock moodle install with levelUp, VPL, boost_union and mod_checklist).

I've tried git reset -- hard then git pull with no success.  Any other suggestions?

Average of ratings: -
In reply to Garth Brady

Re: git pull isn't pulling

by Ken Task -
Picture of Particularly helpful Moodlers

"installed Moodle using Moosh/git." ... uhhh ... think you installed via git .... moosh doesn't have a command to install moodle.

What does:

from moodle code directory: fgrep '$release' version.php show?

git branch -a show?

in the code directory, do you have/can you find the *all* the .git related files:

ls -l .git*

Are we still on a shared hosting service?

'SoS', Ken


In reply to Garth Brady

Re: git pull isn't pulling

by Ken Task -
Picture of Particularly helpful Moodlers

Other suggestions ....

Do you have a backup of code prior to attempting upgrade and after the addon plugins were installed?   Don't think your DB tables have been touched yet, but to be on safe side, restore the backup sql dump you made to a new DB change the info in config.php and see if site is back the way it was before update attempt.

Suggestion 2 ...

might have to rebuild git acquired code + the old method of 'copy back' (recursively) config.php, those plugin directories to same location new git acquired code.

On 4 that should result in a minor security update to 4.0.3.

Finish upgrade via command line once the rebuild directory has been moved to document root and old document root has been moved out of the way.

cd moodlecode/admin/cli/

php upgrade.php

'SoS', Ken


In reply to Garth Brady

Re: git pull isn't pulling

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
git diff 

and 

git status

Show you different views of what has changed. You've changed something bit bear in mind that file permissions count as a change. To ignore that, try...

git config core.filemode false

...and try again
Average of ratings: Useful (1)
In reply to Howard Miller

Re: git pull isn't pulling

by Garth Brady -
I think you're right... I noticed a while back that permissions seemed off to me so I ran a fix perms in Cpanel... I'm guessing this is the issue.

So, I ran "git config core.filemode false", and now I'm seeing a whole bunch of warnings:

- Your local changes to the following files would be overwritten by merge:
- The following untracked working tree files would be overwritten by merge:
- Please move or remove them before you merge.
- Aborting
In reply to Howard Miller

Re: git pull isn't pulling

by Garth Brady -
Thanks all for your suggestions... In the end, I'm pretty sure it was a perms problem (my host has a 'fix perms' function that I think I remember running a while back). I ended up deleting all the files except the config.php and then reinstalling using git then copying the config back into place.
Average of ratings: Useful (1)
In reply to Garth Brady

Re: git pull isn't pulling

by Ken Task -
Picture of Particularly helpful Moodlers

Uhhh ... you also copied back your addon plugins as well ... right?

This "'fix perms' function" ... that you suspect was the culprit ... others might host where you host or host somewhere that has the same 'tool' and could fall into same trap ...

Mind sharing where you host? (not site url, but hosting provider)?

'SoS', Ken


In reply to Ken Task

Re: git pull isn't pulling

by Garth Brady -
After I wiped the webroot (git included), I did a fresh git install and then copied the config.php file back into the root. When I logged into moodle, it greeted me with the standard "hey, there are updates here in the db, want to download and install the files that match these plugins" and I then did so.

As for the fix file/folder perms, here's an example of what I'm talking about.
Average of ratings: Useful (1)
In reply to Garth Brady

Re: git pull isn't pulling

by Ken Task -
Picture of Particularly helpful Moodlers

Interesting tool ...

It does say:

"Every file and folder that exists on your website has a set of permissions. If the files or folder’s permissions are misconfigured, your website might not work as expected."

Like many things, there is probably not an 'undo'! smile

Sometimes best that 'human' attempt to control rather than the other way 'round!

Thanks for the feedback and really a warning to those who host with provider seen that the tool may not be an easy fix for a Moodle! smile

'SoS', Ken