Best practices for organizing personal git repositories in /home folder?
There’s a lot of detailed information if you’re dealing with running a git server (/srv/git) or dealing with development (follow your company’s policies), reams of information about how to organize files inside a repository, and some apps will handle their own repository location (chezmoi), but not much about just keeping your personal git repositories organized without cluttering up your home folder:
a lot of Youtube videos are just grabbing a couple files so end up cloning into ~/Downloads and cleaning up later
GitHub and GitLab tutorials just mention clone into the folder of your choice
Codeberg’s “Your First Repository” has you cloning into ~/repositories
so, what have you found to be the cleanest/simplest/most comfortable?
“top-level” folder like ~/repositories or ~/repos ?
move down a level like ~/Documents/repos ?
(make use of an unused XDG folder like ~/Public ? (doesn’t seem likely))
I've also noticed guides cluttering the downloads and home folders by cloning directly to them. My own work around is to make folder called git or github in my home folder. Then each repository gets its own folder within that.
A git workspace is a folder with several git repositories inside of it that are related. You can have multiple workspaces. I have one for my personal code ~/code and one for my work code ~/w
I found, I'll usually have additional files which I don't want to check into the repo, so I can place them underneath project_name/ instead.
In particular, I'll also often have multiple repos associated with a given project.
Downside: I don't really have a good place for repos, which I clone just to compile the given software for personal usage. At this point, I have a ~/Projects/foreign/ folder for them. Although, I guess, it might make sense to have a folder in general for user-installed applications, where I could also have those repos.