Hacker News new | ask | show | jobs
by sparkling 2174 days ago
How about a more low-tech solution? I don't want/need a full-blown web application like Gitlab, just need somethings than auto-syncs my public and private repos so that i can still access everything when Github is down.

Any ideas?

7 comments

Just add another git remote push URL so that your commits are automatically mirrored when you push:

    git remote add origin https://user@gitlab.com/myrepo
    git remote set-url --push --add origin https://user@github.com/myrepo
    git remote set-url --push --add origin https://user@gitlab.com/myrepo
The lowest tech solution is to just wait until the outage is over. It’s 100% free!

Seriously, though, any repo that I work on regularly will be cloned to my local dev environment, so it’s not a hard blocker.

That said, a cron job on a cheap VPS would probably do the trick.

Moreover, GitHub will eventually get these outages under control. Or we'll all be driven to gitlab :)
A lot of people posting complex things. All you need is SSH.

    ssh sparkling@git.example.com
    mkdir project-1.git
    cd project-1.git
    git init —-bare
    exit
    git remote add alternate sparkling@git.example.com:project-1.git

For the syncing part. If you don’t want to do it manually, you can add multiple destinations on the same remote. Someone already mentioned it here, https://news.ycombinator.com/item?id=23818609, https://jigarius.com/blog/multiple-git-remote-repositories
If you are working alone on these projects, store bare git repository in Dropbox and/or similar services that sync data through all your devices.

If more privacy is required, you can use something like gocryptfs to only send encrypted data to these services.

Syncthing is a similar option that doesn't require an external service, also doesn't require local encryption since all data in transit is always encrypted.

This has a big caveat though: there's no locking mechanism that will work reliably on the bare git repo, so you may have to resolve some conflicts manually if two separate devices push to the same git repo at the same. This is why you should only use this method of you work alone on these repos.

It's still a full full blown web app but I can highly recommend gitea. It's just a single binary so getting setup is really easy. I run an instance and it literally requires no maintenance.
never trust external tools in your build process, you may have an emergency and not be able to fix.

we are trying to migrate to https://www.sonatype.com/nexus-repository-oss (self hosted), it would cache the git tags and you just have to replace the git links to nexus like in the dependency manager.

if you want something simpler, you can try satis for php, sinopia or verdaccio for npm packages. you will find a lot of other tools for the other languages.