How do you organise your code on your machine? I don't mean github/bitbucket, but actually on your hard drive?
I always create a directory called "Projects" under my username:
/Users/seanxe/Projects/
Inside there i group into various folders:
├── github.com/
| ├── username/
| ├── username/
├── project1/
├── project2/
├── playground/
| ├── js-test-1
How do you organise your code?
Top comments (32)
A folder called
projects/
withclients
,school
,sideprojects
andtemplates
as subfolders.What I'd really love though, is for DropBox to come with a
.gitignore
like file so I can finally stash everything on Dropbox, minus thenode_modules
and such.I'm surprised they wouldn't have that.
Right? If you google the issue you'll find hundreds of requests for it, and some workaround solutions, but if Dropbox would just natively support it, that would be so nice!
C:\Code\{project_name}
. I try to keep the complete path as short as possible, because once in a while I end up having to type the whole thing into a terminal.Almost same here!
C:\Projects\{project_name}
to keep path names short.My variation:
D:\development\projects
with SDKs or compiled libraries inD:\development\sdk
C:\git
In my home folder, I have a directory titled
Code/
, which contains all my programming work overall. Within that, I haveRepositories/
for anything tracked by Git (I also have arepos/
link in my home folder to that. I also have a few other folders for different types of code - stuff I'm studying, "firing ranges" (for testing ideas outside of Git), and so forth.firing ranges is a great term!
Almost everything's in
~/work
. I keep a~/scripts
for useful Bash/SQL/etc files that don't belong in source control and that I don't want to commit to my dotfiles for various reasons.If I'm working on a complex project with multiple modules, I'll create
~/work/projectname
and group them under that.~/Workspace/<Language>/<theme>/<project>
For example:
~/Workspace/Python/mailing/easy_mail
It helps me to keep an organized structure when I need to switch between different projects from different languages and it's more understandable when open in Sublime Text
That's really interesting!
So if you had a client side app written in JS, and an API (that complements the client side app) written in python, they would be in completely different locations?
Does that not get frustrating having them "so far apart", so to speak?
In this case, I group it into the main language folder. For example, if I have a huge project in language X but also using some Y, then I include it into the structure:
~/Workspace/X/<project_type>/<project_name>
with sub folders matching my structure (/third_parties
,/tools
, etc.)But indeed, when I will work on projects containing several languages, it would be a mess and I would change this.
I always have issues with that!! I don't know if directory layout should be techonology- or business- centric..
For example..
I am working on some little AWS project. There is current dir layout
should it be rather:
All my projects are in
/www
I use gitlab to manage my git repos and it allows me to create groups. The group names reflect the same names as the above. Even though you didn't ask for it. The way I manage my gitlab helps me navigate my hard drive very nicely.
Almost the same as the others wrote here, I do keep all my work under
~/x/projects
.The reason behind the
x
folder is historical, and I only keep it for backward compatibility (with the old me 😂). And yes, I ONLY use Linux based distros on my local machine, mostly Ubuntu.Under the "projects" dir I usually (not always, especially if it's one-time contribution) keep the subfolder names follow
{report owner}/{repo name}
convention, which basically mirrors my GitHub work (my rule is, if it's not on GitHub then it's probably in~/x/trash
)I have two directories:
~/source
for personal projects~/work/source
for company projectsThe structure in bot directories is the same. Here my work directory:
Because we working with a monorepo, I have not so many more directories in my
source
folder. Thedocument
directory contains all my presentations, nodes, etc. in a company wide available git repository.on macOS, in
/Users/<user-name>/Code/
(a.k.a.~/Code
):For example:
~/Code/github.com/dallas/grommet/
for my fork of the Grommet repo on GitHub.