Just a simple Git repositories organization model

In this story, I will share a simple and straightforward model that I use to keep my Git repositories organized.

In a nutshell

The model is simple:

HOME / SERVICE / ACCOUNT / REPOSITORY

Where HOME is your home directory, SERVICE is the Git repository service (like GitHub or BitBucket), ACCOUNT is the account that owns the repository and REPOSITORY is the repository name.

A few (and real) examples that I use. First, a personal project in my personal Mac workstation:

/Users/bruno/GitHub/brunitto/beck

Then, the Ansible playbooks that I use within an automation Linux server:

/home/bruno/Stash/operations/playbooks

Finally, some team documentation using Markdown, in my profissional Windows workstation:

C:\Users\bruno\Stash\operations\docs

Start at home

First, keep all your files under your home directory. It will work for any operating system and simplifies environment setup, file permissions and even a backup process.

Use Git repository services

Second, always use an external Git repository, it will help you to organize and as a backup alternative. There are awesome services like GitHub and BitBucket.

Accounts as namespaces

Third, there are a lot of repositories called api or docs. Using an account as context creates a namespace, avoiding repository name conflicts.

Last but not least

Finally, the repositories. I suggest using only lowercase characters, using dashes or underscores as separators, avoinding special characters — possibly keeping it under ANSI.

To be organized is not a talent, is a way of operating.