Structuring Git repositories

Thread Starter

Kittu20

Joined Oct 12, 2022
511
I’m a hobbyist looking to understand how Git repositories are structured in a professional environment. Specifically, I’d like guidance on:

  1. When creating a Git repository, how do you typically structure the folders? Do you separate source code, documentation, tests, and configurations into distinct directories?
  2. What are the best practices for organizing a repo that supports both development and production environments effectively?
  3. How do you maintain a clean, scalable structure that’s easy to manage?

If you need a specific project to provide an example, you can assume a "Door Access Control System" project.

Any advice would be greatly appreciated. Thank you!
 

nsaspook

Joined Aug 27, 2009
16,298
I’m wondering if there are any Git users here who could share their experience?
Here is the #1 example:

https://git.kernel.org/pub/scm/
All of these 'trees' are merged into the main branch.
https://github.com/torvalds/linux

I normally just use the IDE folder organization for the repo, nothing special.
Many have GIT integrated into the IDE.
https://netbeans.apache.org/tutorial/main/kb/docs/ide/git/

The Apache NetBeans IDE provides support for the Git version control system. The IDE’s Git features let you perform versioning tasks directly from your projects and code within the IDE. This document demonstrates how to perform versioning tasks in the IDE by guiding you through the standard workflow when using Git.
Git is a free and open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Every Git clone is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server. Branching and merging are fast and easy to do. Git is used for version control of files, much like tools such as Mercurial, Subversion, CVS, and Perforce.

A working branch for HA_ENERGY. This code optimizes energy usage and storage for my solar energy bank.
https://github.com/nsaspook/ha_energy/tree/fsm_main/bmc/ha_energy
Netbeans code graph of functions.
1725740179502.png
 
Last edited:
Top