Live data from Hacker News

You already have a Git server

maurycyz.com

361–370 of 454 posts

Re: You already have a Git server

#361

Beware of using this to publish static sites: you can accidentally expose your .git directory to the public internet. I got pwned this way before (by a pentester fortunately). I had to configure Apache to block the .git directory.

Instead of excluding non-public directories, I like to make an explicit `public` directory (or `doc`, `doc-root`, whatever you want to call it). Then configure your server to point to that subdirectory and don’t worry about the repo. I usually throw `etc` and `log` directories at the top level as well and out my server config in etc, and have a gitignite rule to ignore everything in logs, but it’s there and ready for…

You can still get hit by a path traversal exploit. The safest option is to only have the public files on the server.

Re: You already have a Git server

#362
post #310

Earlier quoted context omitted.

This is classic git usage. A "pull request" was literally just asking someone to pull from your branch. GitHub co-opted the term for their own thing. The thing that people really don't seem to get these days is how your master branch is a different branch from someone else's master branch. So pulling from one master to another was a normal thing. When you clone you get a copy of all the branches. You can commit to yo…

On GitHub, too, a "pull request" is literally just asking someone to pull from your branch.

Except your branch has to be on GitHub. The point is pulling used to happen across different repos a lot more.

Re: You already have a Git server

#363

Earlier quoted context omitted.

It just doesn't make sense to me unless it's a company policy type of thing.

Exactly, it doesn't make sense other than that folks don't actually know how to do even the most basic thing with git (git init).

Tons of people never even touch git cli, they use some gui frontend/IDE.

Tons of people who DO use git cli don't know git init. Their whole life was create a project on github and clone it. Anyway initting new project isn't the most "basic" thing with git, it is used less than .01% of total git commands

if you combine the above easily MOST people have no idea about git init

Re: You already have a Git server

#364
post #149

Cannot emphasize this whole notion enough; Very roughly, Github is to git what gmail is to email. It's mostly probably fine if that's the thing most of everybody wants to use and it works well; but also it's very unwise to forget that the point was NEVER to have a deeply centralized thing -- and that idea is BUILT into the very structure of all of it.

I'd say GitHub is to git what Facebook is to email.

GitHub's value is in network effects and features like big and issue tracking.

At least Gmail is still an email client that communicates with other systems.

Re: You already have a Git server

#365
Self hosting Git isn’t just geek freedom, it’s a mindset of redundancy. I’ve had repos vanish due to platform bans that’s when it really hit me that “distributed” isn’t just a design, it’s a reminder of responsibility.

Re: You already have a Git server

#366

Earlier quoted context omitted.

It still blows my mind how git has lost it's original ideas of decentralized development because of github and how github, a for-profit - centralized - close-sourced forge, became the center for lots of important open source projects. We need radicle, forgejo, gitea to catch up even more!

It didn't really lose the original ideas. It just never learned that people don't want to use it the way kernel devs want to use it. Git never provided an easy github-like experience, so GitHub took over. Turns out devs in general are not into the "setup completely independent public mailing lists for projects" idea.

> Turns out devs in general are not into the "setup completely independent public mailing lists for projects" idea.

My feeling is that devs in general are not into the "learning how to use tools" idea.

They don't want to learn the git basics, they don't want to learn the cmake basics, ...

I mean that as an observation more than a criticism. But to me, the fact that git was designed for those who want to learn powerful tools is a feature. Those who don't can use Microsoft. It all works in the end.

Fun fact: if I want to open source my code but not get contributions (or rather feature requests by people who probably won't ever contribute), I put my git repo on anything that is not GitHub. It feels like most professional devs don't know how to handle anything that is not on GitHub :-). Bonus point for SourceHut: if someone manages to send a proper patch on the mailing list, it usually means that they know what they are doing.

Re: You already have a Git server

#368

I feel like something was lost along the way. git init —-bare will give you a git repo without a working set (just the contents typically in the .git directory). This allows you to create things like `foo.git` instead of `foo/.git`. “origin” is also just the default name for the cloned remote. It could be called anything, and you can have as many remotes as you’d like. You can even namespace where you push back to th…

git clone --mirror is another good one to know, it also makes a bare repository that is an exact clone (including all branches, tags, notes, etc) of a remote repo. Unlike a normal clone that is set up for local tracking branches of the remote. It doesn't include pull requests, when cloning from github, though.

I've used this method to make a backup of our 80+ repo's at a previous company, just grab the url's from the api & run the git clone in a for loop. Works great!

Re: You already have a Git server

#369
In interviews, I've literally asked senior devops engineers and senior software engineers if they have hosted their own git servers and how to initialise one and not a single one has mentioned git init --bare..... which is disconcerting. They can deploy appliances (like gitlab, gitea) and build pipelines just fine, but none of them realized how git actually works underneath and how simple it all is.

Re: You already have a Git server

#370
post #297

Earlier quoted context omitted.

GH is essentially an unlimited storage space. There are countless scripts which makes it possible to even use it as an unlimited mounted storage

And then one day orange gets pissed of at yet another country and it (the repo) is gone

orange ?
Post reply on HN