OPL Maintenance

OPL Update Error

OPL Update Error

by David Nawrocki -
Number of replies: 4
Whenever I try to update the OPL using "git pull" I get the error message
"The following untracked working tree files would be overwritten by merge:"
Then I get a long listing of files from the Contrib directory. Then I get another message
"Please move or remove them before you can merge.
I tried renaming the Contrib directory and creating an empty Contrib directory but then I get a similar message about overwriting some file called .gitignore which I can't even find and the process aborts. Any help would be appreciated.

In reply to David Nawrocki

Re: OPL Update Error

by Alex Jordan -
I would start by renaming that folder Contrib (And removing/overwriting the empty Contrib you created).

Then what does "git status" tell you?

It sounds like it will tell you that files in the Contrib folder have been edited. Does it make sense that such files would have been edited? Like, are the edited files that "git status" reports specific to files in the Contrib folder from your school? If so, then the edits should probably be assessed, staged, and committed.

But it's hard to say without seeing what exactly has changed in the Contrib folder. Once you identify one file name that is reported from "git status", then try "git diff filename" to see what has changed with that specific file. This could be enough of a clue to move forward.
In reply to David Nawrocki

Re: OPL Update Error

by Danny Glin -
It sounds like your copy of the OPL got updated outside of git, so when git tries to update it worries about overwriting the files that it isn't tracking.

If you haven't made any local changes to the OPL directories, then you can restore a file or directory to its original state (from when you last updated the OPL) using the 'git checkout' command. Note that this will overwrite any local modifications you have made.

In your scenario, try:
git checkout Contrib
git checkout .gitignore

You can do this for any other file it complains about, though at some point it might be easier to just start fresh with a new copy of the OPL (assuming you haven't made any local changes).
In reply to Danny Glin

Re: OPL Update Error

by Michael Gage -
If you have made local changes to Contrib that you would like to keep and perhaps contribute to the Contrib directory of the webwork problem library you should add and commit those files.

git add ....file names
git commit -m"Message about what is in this commit".

At that point git will stop complaining.

A file still might get changed if someone else has also changed that file in the upstream Contrib directory but you would probably get a 'conflict' warning and have a chance to preserve your version or accept theirs. In either case you would have an archival record of your version which you could revert back to (once you figure out the proper git commands. :-) )

Git is pretty fussy about even small changes, so I believe even changing the permissions on a file might be enough to prompt git to give you a warning about overwrites.

In reply to David Nawrocki

Re: OPL Update Error

by David Nawrocki -
Thanks for everyone's input. This is what I finally got to work.

1. I backed up Contrib and created an empty Contrib folder with the same permissions.
2. I backed up Pending and created an empty Pending folder with the same permissions
3. I backed up .gitignore and ran "git checkout .gitignore"
4. I updated the OPL by the usual commands.

This seemed to work.

Note: I tried backing up the OpenPublicLibrary and creating an empty OpenPublicLibrary folder then running "git pull" and updating but something went wrong and I had to reinstall the backed up folder and update again. Not sure what happened there. Anyway, I hope this helps someone else and always remember CREATE BACKUPS OF FOLDERS AND FILES BEFORE MESSING WITH YOUR SYSTEM!