GIT/Repository Question

Hey all,

Still coming up to speed on using GIT. So far I think I’ve moved from crawling to walking. Thanks to @Kem_Tekinay for his Zoom meetings. Very helpful!

I’m seeing on thing consistently whenever I switch branches and that is that Xojo keeps prompting me for some image files. This happened when I first started using GIT as a gathered all my project files into a directory structure that is different than what I am using now. Whenever I checkout a different branch, Xojo wants to load these image files from the wrong path. I resolve the issue, save things and commit the changes, but it never gets fixed. As soon as I switch branches, boom! - Up comes the resolve window again. Not difficult to work with but annoying.

How can I fix this permanently. I have looked in the different files trying to see where the reference is to that wrong file path and just change it. I can’t find that but it is somewhere in some file.

Any suggestions anyone?



It should be in the main project file ("*.xojo_project"). Open that in a text editor and see if anything sticks out. The format of each entry is pretty straightforward.

I edited my main project file to change the absolute path Xojo put by default (/User/me/project/resources/imagename.jpg) to a relative path (resources/imagename.jpg).

1 Like

You can also use “…/” in relative paths if the file you’re referencing lives in some level about the project file.

I’ve tried that. The image file that says is missing from an image set isn’t in the .xojo_project file. Nor is the file path in question…

I haven’t used Image Sets, but is that a separate file you can check?

Not that I can see. When I open the project this is what I get:

Then when I resolve I get this path:

The correct last part of the path is:

/Coding Projects/mediaswitcher/Images/SelectionKnob0Degrees.png

So somewhere there’s a file that has the wrong path reference. But no matter what I do to update the file/repository/etc. it always comes back to the wrong path!

After you update this and save, you will see which file has changed in Git. If you don’t, it means it’s a file you’ve ignored.

Aha! It’s the “Xojo_image” file. But what’s weird is of all the files shown in the window, only the first one is showing as modified. And why does the save not stick between forks?

Wait - perhaps it’s because I actually clicked on this one file in Xojo and did a “show on disk” - maybe that forced the update. I don’t think I’ve ever seen the Xojo_image file in the local changes before…

OK. I found it. For some reason, Xojo doesn’t update those image set files. It’s like the mapping to locate them changes something only in local preferences in Xojo and not in the actual settings for the files. I did something to update the path of the first one. The rest were not updated. I manually edited all those files and now they should be good - at least in this branch of code. I’ll check out the other branch I need to have this correct in and update those…

Have you done File > Collect Project Items ?

Yes. The problem was that I did it first in a file path of:

Coding Projects/ForGit/...

And then my colleague had me put everything in a different path of:

Coding Projects/mediaswitcher

So I copied all my items over to the new directory. But the path names for the image sets were set when I did the collect items. And no matter how many times I opened Xojo and “resolved” the issue with location of the images, the actual files were never updated. I could open and close the project fine with no issues, but as soon as I changed the branch of code I was working on, the problem would re-occur.

It should be fixed now…