Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab repository vs project vs submodule

Tags:

gitlab

I started exploring Gitlab for version control management and I got an issue at the first step itsself. When ever I create a project its creating a new repository. I have few webapplications which are independent to each other. In that case do I need to use different repository for every project.

What I am looking for is what is what and when to use what but not able to find what is repository and what is project in gitlab website as well as through other sources as well.

Also I came across a term submodule, when can it be used. Can I create one global project and have all the webapplications as different submodules.

Can any one please help me in understanding the difference between those 3 and when to use what based on their intended way of usage. Also please help me by pointing to a good learning site where I can get the information of doing basic version control operations in gitlab.

Thanks.

like image 831
Vinay Avatar asked Dec 03 '14 21:12

Vinay


People also ask

What is the difference between project and repository in GitLab?

In GitHub, repositories contain the Git/SVN repository, and the project assets such as issues, contribution metrics, etc. However users often refer to repos as projects interchangeably. So in GitLab, we call that container a Project. That includes the Git repository, issues, merge requests, milestones, and much more.

What is submodule in GitLab?

Git submodules allow you to keep a git repository as a subdirectory of another git repository. Git submodules are simply a reference to another repository at a particular snapshot in time. Git submodules enable a Git repository to incorporate and track version history of external code.

Is Git submodule a good idea?

Git submodules may look powerful or cool upfront, but for all the reasons above it is a bad idea to share code using submodules, especially when the code changes frequently. It will be much worse when you have more and more developers working on the same repos.

What is a GitLab repository?

GitLab is a web-based Git repository that provides free open and private repositories, issue-following capabilities, and wikis. It is a complete DevOps platform that enables professionals to perform all the tasks in a project—from project planning and source code management to monitoring and security.


1 Answers

Gitlab manages projects: a project has many features in addition of the Git repo it includes:

  • issues: powerful, but lightweight issue tracking system.
  • merge requests: you can review and discuss code before it is merged in the branch of your code.
  • wiki: separate system for documentation, built right into GitLab
  • snippets: Snippets are little bits of code or text.

So fear each repo you create, you get additional features in its associated project.
And you can manage users associated to that project.

See GitLab documentation for more.

The Git repo and Git submodule are pure Git notions.

In your case, a submodule might not be needed, unless you want a convenient way to remember the exact versions of different webapp repo, recorded in one parent repo.
But if that is the case, then yes, you can create one global project and have all the webapplications as different submodules.
Each of those submodules would have their own GitLab project (and Git repo).

like image 166
VonC Avatar answered Oct 24 '22 05:10

VonC