Show HN: Everybody should create a practice repo
github.com
github.com
---
Like, right now.
---
I also use a personal monorepo for all my projects, including an "experimental" directory for one-off things. However, I am (and you should be) much more careful about what gets committed.
One of my rules is that credentials never belong in the same directory tree as the repository. Entries in .gitignore are not sufficient to prevent accidentally committing sensitive info to the repo. Occasionally this rule takes a little effort -- e.g., some project templates default to using ".env" files for secrets, and to uphold my rule, I need to understand the tool well enough to configure a secure alternative.
Another thing that I find helpful for managing a large number of throwaway projects: a global .gitignore with defaults like "node_modules/", "target/" etc.
In my case, not so much because of the "motivate myself to program everyday" because, well... that's my job, I've programmed every (work)day for many years now.
But it does seem to be a cool way of collecting all the little experiments and fun projects in a single place where you can share them and keep a timeline of what you did.
I'm staring mine.
https://github.com/SriLikesToSing/practice/blob/master/tinke...
What other interesting things could one find in this repository?
Edit: the comment was not about code quality but credentials, explained below.
Personally I'd suggest keeping one's code in separate repos with corresponding READMEs, since otherwise it's pretty hard to realize what you were doing a few months down the line: https://www.readme-templates.com/
This is also good for you to decide what can be public and what should remain private. Furthermore, separate repos are a good idea if you ever want any CI introduced for the project, or build any libraries from it. There's nothing wrong with monorepos, but even those are typically used within the context of a particular project or group of projects.
Maybe don’t get in the habit of committing everything in your learning repo, just in case you’ve accidentally saved something else there.
That's a good point, though! Comment edited, thank you for the clarification.
What you need to do is an interactive rebase, go through all commits, and remove the files by editing the original commits. You can do this with git rebase -i but it is very labor intensive and requires a lot of concentration to get right.
Afterwards your local history will have diverged from GitHub and you need to git push -f to replace the commit history on GitHub with that of your local repository.
It might be a good idea to make the repository private until you have changed all of your passwords and made sure there is no such material in the repository’s history. That doesn’t help if someone already cloned it, though.
Good luck in any case. Hope you have strong passwords and 2FA on your Steam and Gmail.