Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Git - Group several projects and push for first time.

  • 11-02-2014 11:38pm
    #1
    Registered Users, Registered Users 2 Posts: 8,449 ✭✭✭


    Hi guys,

    Just wondering about how I would do this:

    I have a maven project but it has multiple folders. I'm trying to have a base setup project from which I will be able to clone off of so I don't have to do a load of project set up any time in the future. I'll have a fresh copy untouched.

    But when I try to push to git local or even bitbucket I can only do it so that there is no overarching parent folder, just each individual project/submodule.

    My heads a bit melted so it's probably not the best wording.

    e.g.

    -->fresh_setup_project (which I want to be able to just clone from bitbucket)

    > submodule
    > submodule
    > submodule

    basically I want to be able to add to git repo so that the the parent folder is the the top level folder and the others are contained within it. So far I've been doing seperate git repos per submodule...

    Any help? Thanks :D


Comments

  • Registered Users, Registered Users 2 Posts: 586 ✭✭✭Aswerty


    I use Mercurial but I think Git works the same in this case.

    Say if you have a project called MyProject and it has 3 sub folders FolderA, FolderB and FolderC. The way you put the project into source control is that you create a repo inside MyProject. Due to this you won't have your top level directory MyProject. The top level in the repo will be the 3 folders. When you then need to clone this repo what you do is specify the project name to be MyProject. So I think it goes something like this in Git
    git clone "your url" MyProject

    So when cloning this is how you can reapply the top level directory. It does mean different developers may have different top level directory names if they so wish.

    I think the above answers your question.


  • Registered Users, Registered Users 2 Posts: 27,370 ✭✭✭✭GreeBo


    Will the submodules all have the same version (that of the over-arching project)?
    In other words, do you have a pom.xml at the fresh_setup_project level that is listing submodule1-x?

    If not then I would advise against this approach as you are going to have lots of fun with the submodules.


  • Registered Users, Registered Users 2 Posts: 8,449 ✭✭✭Call Me Jimmy


    GreeBo wrote: »
    Will the submodules all have the same version (that of the over-arching project)?
    In other words, do you have a pom.xml at the fresh_setup_project level that is listing submodule1-x?

    If not then I would advise against this approach as you are going to have lots of fun with the submodules.

    Well I managed to work my way through a good tutorial, so what I did was, did the whole git init process for the top level folder and got it working. So if I go onto bitbucket for example, I have the repo and it shows the top level folder. So in a sense I have it working.

    But I'm interested to hear about the problem if I have different version of subprojects? I will probably version them all as the one overarching project version but does it get messy fast if I have them versioned separately?

    There IS an overarching pom in the top level folder.


  • Registered Users, Registered Users 2 Posts: 27,370 ✭✭✭✭GreeBo


    Well I managed to work my way through a good tutorial, so what I did was, did the whole git init process for the top level folder and got it working. So if I go onto bitbucket for example, I have the repo and it shows the top level folder. So in a sense I have it working.

    But I'm interested to hear about the problem if I have different version of subprojects? I will probably version them all as the one overarching project version but does it get messy fast if I have them versioned separately?

    There IS an overarching pom in the top level folder.

    If they all have their versions managed by the top level pom then its fine.
    It could get interesting if you are managing their versions independently yet they are all part of the same branch/tag/etc in GIT.

    Typically I would manage things that are versioned independently in different source control projects so that they can be worked on independently.
    If they are dependencies then separate them out and isolate them in source control, just listing them as dependencies in your poms. If they are truly sub modules then keep them together in source control and manage them as a single version via your multi-module "parent" pom.


Advertisement