With popularity of Github and many other competing offerings, it’s easy to overlook how simple it is to set up (unlimited) private repos on any network connected computer.
But you don’t have to pay anything. During my start up days back in 2012 we had an old gaming box connected to internet, that served as our “unlimited” private git server.
All is needed to set it up is:
On git server
ssh email@example.com # Would be your username and server url here cd /home/demo/ # Some location accessible by all users with ssh access mkdir demo.git # Create new repo cd demo.git git init --bare # Initialize git
On client (any computer that will be pulling/pushing code)
git clone ssh://firstname.lastname@example.org:/home/demo/demo.git cd demo/ git status -s
Note that it’s just like regular
scp command. With
ssh:// being protocol,
demoserver.com site’s URL, and
home/demo/demo.git location of the git repo.
vim README.md git add . git commit -m 'First commit' git push
Now the private repo has the
README.md file committed.
Testing the repo
cd ~/Desktop/ mkdir deleteme cd deleteme/ git clone ssh://email@example.com:/home/demo/demo.git cd demo git log
You should see the
First commit in log.
This approach will not provide “Pull Request” management or issue tracking. If those features are desired, I would recommend looking into an open-source self-hosted solutions like Gitlab.
That being said, as someone who likes to use the command line and hack away on small projects (keeping some of them private), I find the outlined approach to be sufficient for 80% of my use cases.