SO CLOSE: Issue Running Projects from a GIT CLONE

This must be a simple fix. I can't figure it out.

I have local CIQ app project folders loaded into VSC and they compile and run just fine.

I pushed my app folders into a GITHUB repo. And cloned that locally. I want to start using git to keep backups and source control.

In VCS I can then open a cloned folder. If I open one of the project folders it compiles and runs fine. However, if I open the repo's parent folder, so I can see all my projects as subfolders, and then try to run one of my apps, it fails with this.

The subfolder is fine, and runs perfectly if I only open the subfolder. So this has got to be an easy fix. Any ideas?

Top Replies

All Replies

  • 1) It's not standard practice to put multiple projects in a single git repo, although you can do whatever you want I guess. One obvious problem is that you will have a single history for all projects in the repo, which might make tracking changes to individual projects a bit of a pain. It might make sense if all the projects share some common code, but there are better ways to handle that, like git submodules.

    You might notice that most people/orgs who share stuff on github typically have one repo per project, they don't just dump all their code into a single repo.

    You ARE trying to CRAM a SQUARE peg into a round HOLE, but you do YOU.

    2) This problem isn't directly related to using GIT CLONE, the real problem is that you opened a folder in VS Code which is not a project root. YOUR post title doesn't really HELP people help you

    3) The solution here is to use a multi-root workspace in VS Code. https://code.visualstudio.com/docs/editing/workspaces/multi-root-workspaces 

    - Open a new VS Code window

    - Add each project folder separately or select multiple folders to add at once, as described in the linked page

    That way, each project folder is indeed treated as a separate project, and you'll be able to build normally.

  • Great insight. I'll play around with that. I'm pretty new to using these tools. I like having multiple CIQ app projects in VSC concurrently so I can perform "compares" against source code that is shared between 2 apps. And the other issue is this is for a client, into whose repo they want me to put multiple CIQ apps I've developed for them. You've given me some great tips. Thanks.

  • I like having multiple CIQ app projects in VSC concurrently so I can perform "compares" against source code that is shared between 2 apps.

    Right and the way to do that is via a multi-root workspace, which was specifically designed so you can have multiple projects in one VS Code window.

    Besides, as nice as the built-in VS Code compare tool is, there are much better external graphical diff tools, which have features like the ability to compare folders, not just individual files, like Beyond Compare.

    The best thing about Beyond Compare - when it comes to comparing source files - is that you can manually align lines in the diff, for those times when the built-in diff algorithm gets confused and thinks that you deleted 200 lines and added the same 200 lines elsewhere, instead of recognizing that you simply moved 1 line to a new location 200 lines away.

    Also, it sounds like you are "sharing" code between apps by simply copy-pasting code from app to app. As I alluded to above, this isn't really the best way to do things. It will become a maintenance nightmare once you start adding features and fixing bugs in the shared code.

    Since everything is in one big repo anyway, you may as well put shared code in a common folder and use one or more of the following techniques to reference it in multiple projects:

    - Monkey barrels

    - Symbolic links

    - Overriding source paths in project jungle files

    And the other issue is this is for a client, into whose repo they want me to put multiple CIQ apps I've developed for them

    That's fair. But if they were my client, I would tell them that this is not a best practice for maintaining multiple projects.

  • Ok this was very easy. I get that this isn't best practice, but as you suggested, it was as easy as opening one of my subfolders in the cloned repo, which creates a workspace, then simply adding a folder to the workspace which is my 2nd CIQ app. Now they are both concurrently active in VSC and both compile and run perfectly. Thank you.