Self-hosted GitHub alternative?

Folks,

I’m looking for a self-hosted GitHub alternative that I can just plop into Portainer as a docker-compose and get working.

My main interest is in something that sort of works with GitHub - if there’s a way I can pull repos from GitHub into this self-hosted git using a webUI and maybe even push my changes to repos on GitHub, that would be nice. I’m not hard-and-fast on this though as this is mostly an experiment right now and I don’t know why I need this.

What are you folks using to host your super secret local code and why?

skimm,

Since I haven’t seen it mentioned yet, I’ve been using Soft Serve on my server. Just a git server with terminal UI and easy to manage.

anzo,

onedev.io wasn’t mentioned.

Also, be aware that gitea was forked by the community into forgejo because of reasons.

wer2,

I have liked onedev so far.

cancanman,

I’m using GItea and it’s been working great. Very easy to set up in docker.

Rearsays,

Forgejo

nebs,

Why instead of gitea though? I thought the “for profit” stuff was only to provide the original developers of gitea the ability to provide paid support to commercial clients.

fnv,

Unfortunately not available on TrueNAS

Rearsays,

Everything is you just must first learn docker

fnv,

Heh, I was running linux with docker on top of Trunas for several months because of Jellyfin was not available to run in jail. I was not happy because it wasted the server resources and also my resources to maintain it. I don’t want go such way again.
Happy running gitea in jail and when forgejo will be also available in jail I will probably move to its.

Vilian,

gitlab can be selfhosted

herrvogel,

And is hilariously overkill for what OP seems to want. It’s a pretty large and heavy package that comes with a whole lot of (for OP unnecessary) features.

mariom,

Forgejo. Gitlab will be overkill probably.

newIdentity,

GitLab or GitTea

ratz,

What? Gitea. Gitlab is a complete devops platform. Awesome, but complete overkill.

Why? Because I regularly commit code atrocities and have a hard enough time dealing with imposter syndrome, I don’t need to add public shaming on top of it (And just data sovereignty I guess)

ErwinLottemann,

Gitlab can be registration only, so noone else can see your code crimes (when self-hosted)

misterzero,

If people could see my code crimes, I would be in code jail for life.

ShunkW,

I’m sure I’ve committed many code crimes. But the one that should send someone to jail that I’ve personally seen was when I found an eval in production code that was actively being exploited. Put up a PR to fix it and was given a very hush hush meeting that it was there intentionally to fix production data issues secretly because the bureaucracy made it hard to do lol. I just kept my mouth shut and eventually used it once myself.

Bakkoda,

Code crimes. It’s kind of a weird feeling to not know you are guilty of something until you see a name for it.

ErwinLottemann,

No worries! I wasn’t judging 😬

russjr08,

I currently use GitLab, but if I were doing things from the start I’d go with Gitea or Forgejo since its lighter. Though I do quite like GitLab CI (which is why I didn’t go with the other initially) but these days I hear Gitea has Actions support built in.

ErwinLottemann,

Gitlab also has issues, error tracking via sentry and much more. If you want only something nice to host your code go with Gitea, if you also want to manage your project or do auto releases, use gitlab.

domi,
@domi@lemmy.secnd.me avatar

I’m in the same boat. GitLab CI is so nice that I still host it, even if everything else is overkill.

520,

Gitlab can do what you need

krnl386,
@krnl386@lemmy.ca avatar

That’s a pretty hefty solution. Gitlab is a monster nowadays…

GOGS, Gitea/Forgejo can do 90% of what Gitlab does and are much lighter.

Aux,

Why do you want that? Plain git can do everything you actually need.

mhzawadi,
@mhzawadi@lemmy.horwood.cloud avatar

Without knowing why you need a local GitHub like tool is almost impossible to suggest, but I know Gogo’s can keep a remote in sync if you need. Also there is a python tool to backup your GitHub account and or organisation

Anafroj, (edited )

Obligatory check : are you sure you really need a forge? (that’s the name we use to designate tools like Github/Gitlab/Gitea/etc). You can do a lot with git alone : you can host repositories on your server, clone them through ssh (or even http with git http-backend, although it requires a bit of setup), push, pull, create branches, create notes, etc. And the best of it : you can even have CI/CD scripts as post-receive hooks that will run your tests, deploy your app, or reject the changes if something is not right.

The only thing you have to do is to create the repos on your server with the –bare flag, as in git init --bare, this will create a repos that is basically only what you usually have in the .git directory, and will avoid having errors because you pushed to a branch that is not the currently one checked. It will also keep the repos clean, without artifacts (provided you run your build tasks elsewhere, obviously), so it will make all your sources really easy to backup.

And to discuss issues and changes, there is always email. :) There is also this, a code review tool that just pop up on HN.

And it works with Github! :) Just add a git remote to Github, and you can push to it or fetch from it. You can even setup hooks to sync with it. I publish my FOSS projects both on Github and Gitlab, and the only thing I do to propagate changes is to push to my local bare repos that I use for easy backups, they each have a post-update hook which propagates the change everywhere it needs to be (on Github, Gitlab, various machines in my local network, which then have their own post-update hooks to deploy the app/lib). The final touch to that : having this ~/git/ directory that contains all my bare repos (which are only a few hundred MB so fit perfectly in my backups) allowed me to create a git_grep_all script to do code search in all my repos at once (who needs elasticsearch anyway :D ) :


<span style="color:#323232;">#!/usr/bin/env bash
</span><span style="color:#323232;"># grep recursively bare repos
</span><span style="color:#323232;">
</span><span style="color:#323232;">INITIAL_DIR=$(pwd)
</span><span style="color:#323232;">for dir in $(find . -name HEAD -exec dirname '{}' ;); do
</span><span style="color:#323232;">  pushd $dir > /dev/null
</span><span style="color:#323232;">  git grep "$*" HEAD > /dev/null
</span><span style="color:#323232;">  if [[ "$?" = "0" ]]; then
</span><span style="color:#323232;">    pwd
</span><span style="color:#323232;">    git grep "$*" HEAD
</span><span style="color:#323232;">    echo
</span><span style="color:#323232;">  fi
</span><span style="color:#323232;">
</span><span style="color:#323232;">  popd > /dev/null
</span><span style="color:#323232;">done
</span>

(note that it uses pushd and popd, which are bash builtins, other shells should use other ways to change directories)

The reason why you may still want a forge is if you have non tech people who should be able to work on issues/epics/documentation/etc.

otl,
@otl@lemmy.sdf.org avatar

And sharing changes can be done with just email and regular git! git-send-email.io

liliumstar,

Another +1 for gitea. It works quite well and is easy to setup.

mholiv,

+1 For Gitea. Works really well for me. It recently added GitHub style actors so you can use GitHub style CI/CD too!

nbafantest,

I’d probably just run gitlab and use the gitlab images, as that’s one of the solutions git recommends

  • All
  • Subscribed
  • Moderated
  • Favorites
  • selfhosted@lemmy.world
  • Durango
  • DreamBathrooms
  • InstantRegret
  • magazineikmin
  • osvaldo12
  • everett
  • Youngstown
  • khanakhh
  • slotface
  • rosin
  • thenastyranch
  • ngwrru68w68
  • kavyap
  • normalnudes
  • megavids
  • ethstaker
  • GTA5RPClips
  • modclub
  • cisconetworking
  • mdbf
  • tacticalgear
  • cubers
  • provamag3
  • tester
  • anitta
  • Leos
  • JUstTest
  • lostlight
  • All magazines