Where Do You Guys Throw Your Local Git Repos?

data1701d (He/Him)@startrek.website to Linux@lemmy.ml – 117 points –

Personally, to keep my documents like Inkscape files or LibreOffice documents separate from my code, I add a directory under my home directory called Development. There, I can do git clones to my heart's content

What do you all do?

83

~/dev/, with project/org subdirectories

Admittedly, that irks me slightly just because of the shared name with the devices folder in root, but do what works for you.

I actually have my whole home directory like that for that reason haha

bin - executables
dev - development, git projects
doc - documents
etc - symlinks to all the local user configs
med - pictures, music, videos
mnt - usb/sd mountpoints
nfs - nfs mountpoints
smb - smb mountpoints
src - external source code
tmp - desktop

~/src/ Simple, effective, doesn't make my home folder any more of a mess than I already left it as.

Same, but by language, e.g. Development/Python.

Thinking of the projects I work on, I don't understand the value in categorizing by language, rather than theme (~/Development/Web/, ~/Development/Games/) or just the project folders right there.

Yeah, everyone has to find their own way of organising, I guess. For me, there are too many different little projects that it would get messy throwing them all in one folder. And they’re so varied that I couldn’t think of one single “theme” or topic for most of them. Nothing I would remember a week later anyways.

Like others, I have a folder in my home directory called "Code." Most operating systems encourage you to organize digital files by category (documents, photos, music, videos). Anything that doesn't fit into those categories gets its own new directory. This is especially important for me, as all my folders except Code are synced to NextCloud.

~/git/vendor//

and

~/git////

Examples:

~/git/vendor/EnigmaCurry/d.rymcg.tech
~/git/mike/forgejo/mikew/myproject
~/git/mike/github/johndoe/otherProject

~/workspace/git

That way I can also keep other stuff in the same "workspace" directory and keep everything else clean

I have a Code, simulations, ECAD, and FreeCAD folder in the workspace folder where projects or 1-offs are stored and when I want to bring them to git, I copy them over, play around in the project folders again, then copy changes over when I am ready to commit.

I could better use branching and checking out in git, but large mechanical assemblies work badly on git.

I tend to follow this structure:

Projects
├── personal
│   └── project-name
│       ├── code
│       ├── designs
│       └── wiki
└── work
    └── project-name
        ├── code
        ├── designs
        └── wiki

Is "code", "designs" and "wiki" here just some example files in the repo or are those sub-folders, and you only have the repo underneath code?

They are the project's subfolders (outside of the Git repo):

  • code contains the source code; version-controlled with Git.
  • wiki contains documentation and also version-controlled.
  • designs contains GIMP, Inkscape or Krita save files.

This structure works for me since software projects involve more things than just the code, and you can add more subfolders according to your liking such as notes, pkgbuild (for Arch Linux), or releases.

Ah, interesting. In my current setup, I dump the auxilliary files into a folder above the repo, but it can certainly make it a bit messy to find the repo in there then...

I maintain a rule that all files above the repo must be inside a folder, with one exception: a README file. Including the code folder, this typically results in no more than 5 folders; the project folder itself is kept organized and uncluttered.

I used to use ~/devbut for years now I use ~/Workspace becaue Eclipse made me do it

~/projects for things I made

~/git for things other people made

~/git, for projects I cloned from the web because I don't know how to code :(

Most of my code and some non-code is under ~/src, but I have repos scattered all around for other things.

~/code for everything I want to change/look at the source code.

~/.local/src for stuff I want to install locally from source.

I use ~/workspace . I think I got this from when I first started using Java years ago. Eclipse created new projects in this directory by default maybe?

~/Projects/$TOPIC_OR_LANGUAGE/$PROJECT_NAME

ie.

  • ~/Projects/Web/passport.ink for a web dev project
  • ~/Projects/Minecraft/synthetic_ascension for a Minecraft mod
  • ~/Projects/C++/journalpp for a C++ library

/mnt/shared/Development or E:\Development depending on which operating system is running.

Not in home mainly because I use the same directory in windows and Linux.

For my personal projects I use ~/dev/projects/

For clones I use ~/dev/clones

My audio engineering stuff is at ~/audio/{samples, plugins, projects, templates}

Usually ~/devel/

On my work laptop I have separate subdirs for each project and basically try to mirror the Gitlab group/project structure because some fucktards like to split every project into 20 repos.

~/code/git//

Mostly a holdover from when I regularly pulled svn/hg/cvs repos and needed reminding what tool to use for which project.

No idea why I still do it.

/mnt/external_ssd_1/git_repos/reponame

i trust my workstations os to still be working in the morning as much as i trust the chances i even published the stupid branch after making it.

Any naming convention is fine as long as it's meaningful to you. But it's a good idea to keep your own repos separate from the random ones you clone from the internet.

For a project called "Potato Peeler", I'll put it into a structure like this:

~/Projects/Tools/Potato-Peeler/potato-peeler/

Tools/ is just a rough category. Other categories are, for example, Games/ and Music/, because I also do gamedev and composing occasionally.

Then the capitalized Potato-Peeler/ folder, that's for me to drop in all kinds of project-related files, which I don't want to check into the repo.

And the lower-case potato-peeler/ folder is the repo then. Seeing other people's structures, maybe I'll rename that folder to repo/, and if I have multiple relevant repos for the Project, then make it repo-something.

I also have a folder like ~/Projects/Tools/zzz/ where I'll move dormant projects. The "zzz" sorts nicely to the bottom of the list.

~/Sources for stuff I'm only building from sources and no immediate intention to contribute to

~/Projects for stuff I'm involved in, with a following structure:

Projects
 - Personal
 - - Art
 - - Music
 - - Code
 - - - Ideas
 - - - In progress
 - - - Deployed
 - - - Scripts
 - - - Abandoned
 - [Company name]
 - - [Project name]
 - Interviews
 - - [Company name]

The last part grouping project by companies has worked great for me, especially with freelance and outsource work. Sorting personal projects into types and stages feels like a mistake, as every time I have to navigate it, I can't help but think of limitations of hierarchical file systems, as some of them are multiple types simultaneously, and also moving projects between stages feels dumb.

~/Documents/projects/--<dd>_</dd>

Personal?

~

My homedir is a HUGE MESS.

Work?

~/src///

i.e. ~/src/github/mirantis/docker (not real I don't imagine, just an example)

~/src/bitbucket/INTERNALPROJECTCODE/coolrepo

Like some other ppl here, I clone everything in a git folder under my home directory.

Personal stuff goes in ~/Projects

Work stuff goes in ~/Work/Code

Same! I also have a separate directory for college assignments and stuff. Gonna set up separate gitconfigs for both soon, so there is a smaller chance of mixing up my credentials

~/Prototypes on pretty much all machines I own, from desktop, laptop, server, tablets, ebook readers, RPis, XR headset, video projector, etc.

Don't worry, the basics are really easy to git get down, you can read any beginner guide to start trying it out, for example this one on baeldung seems pretty alright by a quick skim, or, if you prefer a more playful approach, definitely check out ohmygit.
If you want to try a git hoster as well, make a GitHub profile if you want to go where most everyone is, so you can also easily contribute to others' projects, otherwise, if you care about staying on a free platform, make an account on Codeberg, fewer people, but all great like-minded free software supporters

..or make one on both, ngl

Thanks. I do have a codeberg, a Gitlab and a github account (all I have here are my blacklist and white lists). If my kids allow me, I'll start swimming on this waters this weekend. I've only seen how you guys basically hold repose of pretty much anything and automate workflows and configurations so easily, it's amazing.

Good luck! It can get complicated so I know how you feel looking at weird configurations that do magic

My best recommendation is a good git GUI. I really like Gitkraken (proprietary & freemium unfortunately, but a pretty generous free plan). I'm now more advanced than many of my coworkers because it helped me form an intuitive understanding of git.

~/Code for coding/dev stuff and ~/gitclone for things that i random clone for some reason. =D

Putting one directly under the home directory feels like a psychopathic move, so I stay by XDG and put them under a subdirectory of xdg-documents

In ~/src Mostly because I'm too lazy to type "source".

~/sites

I have always used it. I liked how it was easy to find in the home directory amongst other folders. Then under that I have a folder for every organization, including myself, and repositories live in those folders.

~/gits

Documentation is usually a doc folder inside the repo or just a README.md for small projects.

On Linux I usually just keep them in my home directory because I'm lazy. On Windows though I usually do C:\git\ or D:\git\ if I have a second drive.

~/projs

I like ~/w or ~/p options