Git Lite: Managing Large Repos and the Multi-Remote Secret
AI Disclaimer I love exploring new technology, and that includes using AI to help with research and editing! My digital “team” includes tools like Google Gemini, Notebook LM, Microsoft Copilot, Perplexity.ai, Claude.ai, and others as needed. They help me gather insights and polish content—so you get the best, most up-to-date information possible.
How to keep your laptop lean while syncing to the NAS and GitHub
A while back I wrote Managing my Dev Codebase and Workflow, where I shared how I use my NAS as a central hub for my dev work. But as any hobbyist knows, once you start using Git seriously, you hit a snag: Git repositories can get massive. If you track every change in a project with large assets, your .git folder can eventually dwarf your actual code. On a laptop with limited SSD space, this is a problem. Today, I’m sharing my “Git Lite” approach and how I use the “Multi-Remote” secret to sync my code exactly where it needs to go.
The “Git Lite” Philosophy: Why Not Everything is in Git
One reality of Git is that it stores the entire history of every file change locally on your machine. For a long-running project with large assets or frequent binary updates, your local storage can vanish quickly.
This is why I use a “Git Lite” approach:
- The Heavy Stuff Stays Non-Git: For projects with massive datasets or videos, I keep them in my
Z:\DevCode\nonGitfolder. I don’t need a version history of a 2GB zip file. - The “Check-Out” Method: I only keep the active projects on my laptop. Once a project is “done,” I push it to the NAS and delete the local folder. The NAS holds the heavy history; my laptop stays light.
The Multi-Remote Secret: NAS vs. GitHub
A common misconception is that a Git project can only live in one place (like GitHub). In reality, Git allows for Multiple Remotes. This is the “secret sauce” of my workflow.
My local projects often have two different “remotes” (destinations):
nas: My private, local NAS. This is my “Private Workshop.”origin: GitHub or GitLab. This is my “Public Gallery.”
How it Works in Practice
When I’m working, I can choose exactly where my code goes.
- The Daily Sync: Throughout the day, I run
git push nas. This is lightning fast because it stays on my home network. It saves every messy, “work-in-progress” commit that I’m not ready to show the world. - The Public Release: Once the code is polished and the feature is done, I run
git push origin. This sends the clean version to GitHub for the world to see.
How to Set It Up
If you already have a project, adding a second destination is a single command:
Bash
# Add your NAS as a destination
git remote add nas Z:\DevCode\git\MyProject.git
# Add GitHub as a destination
git remote add origin https://github.com/username/MyProject.git
Now, when I want to see where my code can go, I just type git remote -v. It shows me both my private NAS and my public GitHub.
Handling the “Mismatched” Accounts
Because I’m a hobbyist, I have different projects for different interests. Some belong to my personal GitHub, some to a specialized organization account, and some are strictly private.
With this setup, the “mismatch” is no longer a problem:
- Project A pushes to NAS + Personal GitHub.
- Project B pushes to NAS + Work/Org GitHub.
- Project C (Private/Large) only pushes to the NAS.
My laptop remains the “middleman.” It doesn’t care that the destinations are different; it just follows the map I’ve given it.
What about Git LFS?
Some people ask about Git LFS (Large File Storage). While LFS is a “pro” way to handle big files in Git by replacing them with “pointers,” I’ve found it’s often overkill for hobbyists. My “Git Lite” approach—keeping heavy projects in the nonGit folder and using the robocopy script—is much simpler to maintain and doesn’t require complex server-side plugins on the NAS.
Summary
By separating my history (on the NAS) from my active work (on the Laptop), and using Multi-Remotes to bridge the gap to GitHub, I’ve created a workflow that is:
- Lean: My laptop SSD isn’t choked by years of history.
- Private: My messy “in-progress” code stays on my NAS.
- Flexible: I can sync different projects to different GitHub accounts without breaking a sweat.
It took some trial and error to get here, but “Git Lite” is the reason I can finally focus on coding instead of managing files!
