frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Let's Help NetBSD Cross the Finish Line Before 2025 Ends

https://mail-index.netbsd.org/netbsd-users/2025/10/26/msg033327.html
154•jaypatelani•2h ago•49 comments

10k Downloadable Movie Posters From The 40s, 50s, 60s, and 70s

https://hrc.contentdm.oclc.org/digital/collection/p15878coll84/search
139•bookofjoe•1w ago•18 comments

The bug that taught me more about PyTorch than years of using it

https://elanapearl.github.io/blog/2025/the-bug-that-taught-me-pytorch/
82•bblcla•2d ago•20 comments

Asbestosis

https://diamondgeezer.blogspot.com/2025/10/asbestosis.html
144•zeristor•6h ago•93 comments

Formal Reasoning [pdf]

https://cs.ru.nl/~freek/courses/fr-2025/public/fr.pdf
32•Thom2503•3h ago•0 comments

A worker fell into a nuclear reactor pool

https://www.nrc.gov/reading-rm/doc-collections/event-status/event/2025/20251022en?brid=vscAjql9kZ...
506•nvahalik•14h ago•329 comments

World Simulator: Create and Play Interactive AI Worlds

https://worldsimulator.ai/
17•machmadera•4d ago•20 comments

You Already Have a Git Server

https://maurycyz.com/misc/easy_git/
186•chmaynard•4h ago•157 comments

Eavesdropping on Internal Networks via Unencrypted Satellites

https://satcom.sysnet.ucsd.edu/
68•Bogdanp•5d ago•7 comments

Pico-Banana-400k

https://github.com/apple/pico-banana-400k
278•dvrp•13h ago•42 comments

Show HN: W++ – Garbage-Collected Threads

10•sinisterMage•5d ago•3 comments

Clojure Land – Discover open-source Clojure libraries and frameworks

https://clojure.land/
105•TheWiggles•7h ago•23 comments

The Linux Boot Process: From Power Button to Kernel

https://www.0xkato.xyz/linux-boot/
329•0xkato•16h ago•68 comments

Writing a RISC-V Emulator in Rust

https://book.rvemu.app/
57•signa11•7h ago•15 comments

Advent of Code 2025: Number of puzzles reduce from 25 to 12 for the first time

https://adventofcode.com/2025/about#faq_num_days
175•vismit2000•6h ago•111 comments

Connect to a 1980s Atari BBS through the web

https://www.southernamis.com/ataribbsconnect
25•JPolka•5h ago•0 comments

LaserTweezer – Optical Trap

https://www.gaudi.ch/GaudiLabs/?page_id=578
38•o4c•7h ago•5 comments

D2: Diagram Scripting Language

https://d2lang.com/tour/intro/
178•benzguo•16h ago•39 comments

The Journey Before main()

https://amit.prasad.me/blog/before-main
252•amitprasad•19h ago•87 comments

California invests in battery energy storage, leaving rolling blackouts behind

https://www.latimes.com/environment/story/2025-10-17/california-made-it-through-another-summer-wi...
302•JumpCrisscross•19h ago•244 comments

PCB Edge USB C Connector Library

https://github.com/AnasMalas/pcb-edge-usb-c
114•walterbell•12h ago•45 comments

Bitmovin (YC S15) Is Hiring Engineering ICs and Managers in Europe

https://bitmovin.com/careers
1•slederer•8h ago

The FSF considers large language models

https://lwn.net/Articles/1040888/
15•birdculture•1h ago•3 comments

Why I code as a CTO

https://www.assembled.com/blog/why-i-code-as-a-cto
221•johnjwang•1d ago•172 comments

Project Amplify: Powered footwear for running and walking

https://about.nike.com/en/newsroom/releases/nike-project-amplify-official-images
99•justinmayer•18h ago•94 comments

NextSilicon reveals new processor chip in challenge to Intel, AMD

https://www.reuters.com/business/nextsilicon-reveals-new-processor-chip-challenge-intel-amd-2025-...
108•simojo•3d ago•22 comments

Show HN: Diagram as code tool with draggable customizations

https://github.com/RohanAdwankar/oxdraw
204•RohanAdwankar•18h ago•41 comments

You Should Feed the Bots

https://maurycyz.com/misc/the_cost_of_trash/
90•chmaynard•3h ago•65 comments

How programs get run: ELF binaries (2015)

https://lwn.net/Articles/631631/
121•st_goliath•18h ago•6 comments

GenAI Image Editing Showdown

https://genai-showdown.specr.net/
131•rzk•12h ago•30 comments
Open in hackernews

You Already Have a Git Server

https://maurycyz.com/misc/easy_git/
186•chmaynard•4h ago

Comments

thyristan•2h ago
Maybe I'm too old, but are there people that really didn't know that any ssh access is sufficient for using git?
liveoneggs•2h ago
most people think git = github
halJordan•2h ago
I always found these sort of categorical denigrations to be off base. If most people do think git = github then that's because they were taught it by somebody. A lot of somebodies for "most people". Likely by the same somebodies who also come to places like this. It has always taken a village to raise a child and that is just as true for an infant as a junior programmer. But instead we live in a sad world of "why didn't schools teach person x"
blueflow•2h ago
Humans are fallible, relying on hearsay is unprofessional, learn your craft properly.

Imagine what the equivalent argumentation for a lawyer or nurse would be. Those rules ought to apply for engineers, too.

loloquwowndueo•2h ago
Despite your indignation, the observation that most people think GitHub is git is entirely true. Do you point it out when you spot someone having that mistaken belief? I do.
liveoneggs•2h ago
they were taught by github
Dylan16807•1h ago
What makes you say that people complain about the spread of incorrect knowledge "instead" of teaching? Because there's nothing wrong with doing both.
albert_e•2h ago
IT support and cybersecurity teams responsible for blocking and enforcing network access restriction to "github.com" ... blocked a user request to install "git" locally citing the former policy. The organization in question does IT services, software development, and maintenance as their main business.
jiggawatts•2h ago
That’s… special.
watwut•2h ago
Sometimes I feel like IT and security people compete on how to make the work least possible.

These guys won.

bfkwlfkjf•2h ago
Nonsense...

Even someone who knows that git isn't GitHub might not be aware that ssh is enough to use git remotely. That's actually the case for me! I'm a HUGE fan of git, I mildly dislike GitHub, and I never knew that ssh was enough to push to a remote repo. Like, how does it even work, I don't need a server? I suspect this is due to my poor understanding of ssh, not my poor understand of git.

porridgeraisin•2h ago
> I don't need a server?

You do, an SSH server needs to be running on the remote if you want to ssh into it, using your ssh client - the `ssh` command on your laptop. It's just not a http server is all.

You start that server using the `sshd` [systemd] service. On VPSs it's enabled by default.

Git supports both http and ssh as the "transport method". So, you can use either. Browsers OTOH only support http.

bfkwlfkjf•1h ago
Exactly! Only now the dots connected. Thank you!!

Edit: hey this is really exciting. For a long time one of the reasons I've loved git (not GitHub) is the elegance of being a piece of software which is decentralized and actually works well. But I'd never actually used the decentralized aspect of it, I've always had a local repo and then defaulted to use GitHub, bitbucket or whatever instead, because I always thought I'd need to install some "git daemon" in order to achieve this and I couldn't be bothered. But now, this is so much more powerful. Linus Torvalds best programmer alive, change my mind.

Dylan16807•1h ago
And in general, any daemon that manipulates files can be replaced by ssh (or ftp) access and a local program.

And most things are files.

liveoneggs•2h ago
Did you know that you can use git locally? It works just like that because ssh is a remote shell.

Read https://git-scm.com/docs/git-init#Documentation/git-init.txt...

Anyway it sounds like you have a lot of holes in your git-knowledge and should read some man pages

bfkwlfkjf•1h ago
No, you're wrong. These are holes in my ssh knowledge, and your comment makes me think you have the same holes.
liveoneggs•18m ago
lol you sound like a treat, dude

https://git-scm.com/book/ms/v2/Git-on-the-Server-The-Protoco...

skydhash•2h ago
Git is distributed, meaning every copy is isolated and does not depends on other's copy. Adding remotes to an instance is mostly giving a name to an URL(URI?) for the fetch, pull, push operation, which exchange commits. As Commits are immutable and forms a chain, it's easy to know when two nodes diverge and conflict resolution can take place.

From the git-fetch(1) manual page:

> Git supports ssh, git, http, and https protocols (in addition, ftp and ftps can be used for fetching, but this is inefficient and deprecated; do not use them).

You only need access to the other node repo information. There's no server. You can also use a simple path and store the other repo on drive.

bfkwlfkjf•1h ago
> There's no server.

There IS a server, it's the ssh daemon. That's the bit I had never thought about until now.

skydhash•1h ago
SSH is just a transport to get access to the repo information. The particular implementation does not matter (I think). Its configuration is orthogonal to git.
bfkwlfkjf•58m ago
It's just a transport, and it needs a server.
Joeboy•1h ago
I mean, you do need an ssh server. Basically ssh can run commands on the remote machine. Most commonly the command would be a shell, but it can also be git commands.
bfkwlfkjf•1h ago
Yup! Someone else just pointed it out. Brilliant, thank you!
setopt•2h ago
Yup. I’ve heard several people say that Git is a product from Microsoft…
devsda•2h ago
I wouldn't mind it if those people are from non-tech background.

Now, if it is a growing misconception among cs students or anyone doing software development or operations, that's a cause for concern.

littlecranky67•2h ago
The irony, when you realize that Linus Torvalds created git.
mrweasel•1h ago
There's an interview with Torvalds where he states that his daughter told him that in the computer lab at her college Linus is more known for Git than Linux

Clip from the interview: https://www.youtube.com/shorts/0wLidyXzFk8

ruguo•1h ago
Looks like they’re not developers after all
brucehoult•2h ago
Or just put the repo in a shared directory in a high-trust group of developers (or just yourself).
ryandv•2h ago
Filesystems and folders are foreign and elusive concepts to gen Z.

https://www.theverge.com/22684730/students-file-folder-direc...

liveoneggs•1h ago
I have encountered it in real life many times. These days I try to give jr's extra space to expose their gaps in things I previously assumed were baseline fundamentals - directories and files, tgz/zip files, etc
politelemon•2h ago
Also relatively unknown: You can clone from a directory. It won't accomplish the backup feature but it's another option/feature.
superdisk•1h ago
If you do it over NFS or whatever then you can collaborate as well.
kace91•2h ago
I didn’t know either - or rather, I had never stopped to consider what a server needs to do to expose a git repo.

But more importantly, I’m not sure why I would want to deploy something by pushing changes to the server. In my mental model the repo contains the SOT, and whatever’s running on the server is ephemeral, so I don’t want to mix those two things.

I guess it’s more comfortable than scp-ing individual files for a hotfix, but how does this beat pushing to the SOT, sshing into the server and pulling changes from there?

skydhash•1h ago
There's a lot of configuration possible due to the fact that git is decentralized. I have a copy on my computer which is where I do work. Another on a vps for backup. Then one on the app server which only tracks the `prod` branch. The latter is actually bare, but there's a worktree for the app itself. The worktree is updated via a post-receive hook and I deploy change via a simple `git push server prod`
t_mahmood•2h ago
My way used to be in the past, put bare repos on Dropbox, clone the bare repo to a real path. Done.

That way, I

1. didn't have to worry about sync conflicts. Once complete, just push to origin 2. had my code backed up outside my computer

I can't exactly remember, if it saves space. I assumed it does, but not sure anymore. But I feel it was quite reliable.

I gave that way up with GitHub. But thinking of migrating to `Codeberg`

With `tailscale`, I feel we have so much options now, instead of putting our personal computer out on the Internet.

candiddevmike•2h ago
What are some fun/creative ways to do GitHub/GitLab style CI/CD with this method? Some kind of entry point script on push that determines what to do next? How could you decide some kind of variables like what the push was for?
yule•1h ago
I wrote about that idea here: https://www.stchris.net/tiny-ci-system.html
skydhash•1h ago
`man 5 githooks` is your friend. Hooks are just scripts and they can receive parameters. `post-receive` is most likely what you would want.
CGamesPlay•1h ago
Check the docs for the post-receive hook, it does give everything you need. I don't know what you have in mind by "GitHub/Gitlab style", but it's just a shell script, and you can add in as much yaml as you want to feel good about it.

I did a quick search for "post-receive hook ci" and found this one: https://gist.github.com/nonbeing/f3441c96d8577a734fa240039b7...

bluedino•1h ago
Considering git is one of those things barely anyone knows how to actually use, yes
seba_dos1•1h ago
My theory is that git is just so easy to use without understanding it that you end up with lots of people using it without understanding it :)
BoiledCabbage•54m ago
It's not "so easy to use without understanding it", it's the opposite it has so much unnecessary complexity (on top of a brilliant simple idea btw), that once people learn how to do what they need, they stop trying to learn any more from the pile of weirdness that is git.

Decades from now, git will be looked back at in a similar but worse version of the way SQL often is -- a terrible interface over a wonderful idea.

seba_dos1•42m ago
I don't think that's true. In my experience it takes time, but once it clicks, it clicks. Sure, there is a bunch of weirdness in there as well, but that starts way further than where your typical git user stops.

I don't think git would end up this popular if it didn't allow to be used in a basic way by just memorizing a few commands without having to understand its repository model (however simple) well.

isodev•1h ago
I imagine larger part of the developer community does not, in fact, know that GitHub is not git and one can get everything they need without feeding their code to Microsoft's AI empire. Just another "Embrace, extend, and extinguish"
tuwtuwtuwtuw•1h ago
I would be surprised if more than 10% of git users know that. Would be equally surprised if more than 20% of git users know how to use ssh.

I think your age isn't the issue, but I suspect you're in a bubble.

kleiba•1h ago
The non-Windows bubble?
dtgriscom•1h ago
I actually realized this last week, and have yet to try it. Programming for almost fifty years, using Git for thirteen years, and not an idiot (although there are those who would dispute this, including at times my spouse).
__MatrixMan__•1h ago
I've been using git since 2007, this only dawned on me last year.

Git is especially prone to the sort of confusion where all the experts you know use it in slightly different ways so the culture is to just wing it until you're your own unique kind of wizard who can't tie his shoes because he favors sandals anyhow.

skydhash•1h ago
The Pro Git book is available online for free

https://git-scm.com/book/en/v2

tianqi•1h ago
I like this comment. Over the years I've always found that whenever I see others using git, everyone uses it in different way and even for different purposes. This has left me really confused about what is the standard practice of Git exactly.
haskellshill•59m ago
> all the experts you know use it in slightly different ways

What? Knowing that a git repo is just a folder is nowhere near "expert" level. That's basic knowledge, just like knowing that the commits are nodes of a DAG. Sadly, most git users have no idea how the tool works. It's a strange situation, it'd be like if a majority of drivers didn't know how to change gears.

rco8786•55m ago
The majority of drivers DON’T know how to change gears.

You are simultaneously saying that something is not expert level knowledge while acknowledging that most people don’t know it. Strange.

singpolyma3•47m ago
I think the idea is it shouldn't be expert level. It used to be in every tutorial. But you're right these days it may indeed be expert level knowledge
seba_dos1•31m ago
> The majority of drivers DON’T know how to change gears.

I'm not sure that's true, unless you only take certain parts of the world into consideration.

__MatrixMan__•14m ago
My point is only that the understanding is uneven. I'm ready to debate the merits of subtrees vs submodules but I didn't know the folder thing. Am I weird? Yes, but here is a place where weird is commonplace.
thwarted•1h ago
Yes. I've been subject to claims that a single person can't start a project unless and until an official, centralized repo is setup for them. I've responded with "git init is all that is necessary to get started", but they wouldn't hear it.
fingerlocks•21m ago
You must work at Microsoft? A pound of paperwork for every new repo really shuts down experimental side projects. I showed my colleagues that we can share code via ssh or (painfully) one-drive anytime instead. They reacted like I was asking them to smoke crack behind the dumpsters. “That’s dangerous, gonna get in trouble, no way bro”
victorbjorklund•57m ago
I never thought about it. If somebody had asked me, yeah. Of course it makes sense. But it's just one of those things where I haven't thought about possibility.
nicce•2h ago
Interesting. I am just trying to decide between self-hosting Forgejo and other options for hosting Git in own private network.
omani•2h ago
am using gitea. but thinking of switching to serve (charm).
sesm•2h ago
I'm also using gitea, running on RPI5. Setup took like 15 mins, highly recommend.
omani•1h ago
mine is running on an rpi zero w (v1). super low power consumption.
icy•2h ago
Could also consider running a Tangled knot (lightweight, headless git servers): https://tangled.org
rustman123•2h ago
Does this support private repositories with collaboration?
icy•2h ago
Not yet, unfortunately. Mostly due to protocol limitations—we use AT (https://atproto.com) for federation.
nicce•2h ago
That looks definitely interesting!
01HNNWZ0MV43FF•2h ago
Forgejo is working okay for me.

Hard to justify using SSH for Git. Principle of least power and all that

skydhash•1h ago
Git is distributed, so there's no least power and all that. Everyone has full power over their own copy. What you want is one copy being the source of truth. You can always use HTTP for read-only access to that copy with a limited set of people having write access to update the copy. Patches can be shared via anything (git has built-in support for email).
orblivion•2h ago
One of my favorite tools available for Linux is called gitolite. It's in the Debian repo.

https://gitolite.com/gitolite/

If you think the bare bones example is interesting and want something simple just for you or a small group of people, this is one step up. There's no web interface. The admin is a git repository that stores ssh public keys and a config file that defines repo names with an ACL. When you push, it updates the authorization and inits new repositories that you name.

I put everything in repos at home and a have multiple systems (because of VMs) so this cleaned things up for me considerably.

PaulKeeble•1h ago
A lot of people do host Forejo but unless you are actually working with other people and they need a reduction in access via pull requests it doesn't do much other than provide a pretty GUI to look at. The bare SSH approach makes more sense for personal projects.
singpolyma3•2h ago
One note, xcode and maybe some other clients can't use http "dumb mode". Smart mode is not hard to set up, but it's a few lines of server config more than this hook.

TIL about the update options for checked out branch. In practise though usually you want just the .git "bare" folder on server

saagarjha•2h ago
I feel like this is a bug that Xcode should fix
imiric•2h ago
I've used Git over SSH for several years for personal projects. It just works with no additional overhead or maintenance.

Tip: create a `git` user on the server and set its shell to `git-shell`. E.g.:

  sudo useradd -m -g git -d /home/git -s /usr/bin/git-shell git
You might also want to restrict its directory and command access in the sshd config for extra security.

Then, when you need to create a new repository you run:

  sudo -u git git init --bare --initial-branch=main /home/git/myrepo.git
And use it like so:

  git clone git@myserver:myrepo.git
Or:

  git remote add myserver git@myserver:myrepo.git
  git push -u myserver main
This has the exact same UX as any code forge.

I think that initializing a bare repository avoids the workarounds for pushing to a currently checked out branch.

general1465•1h ago
Yes exactly, creating git user on Linux machine and configuring it just for git turned out to be easiest way how to get Source Tree and Git in Windows work with it out of the box.
amelius•43m ago
Yes, that's how I use it too.

However, this setup doesn't work with git-lfs (large file support). Or, at least I haven't been able to get it working.

PS: Even though git-shell is very restricted you can still put shell commands in ~/git-shell-commands

seba_dos1•2h ago
Just make the repository on the server side bare and you won't have to worry about checked out branches or renaming ".git" directory.
cl3misch•1h ago
> This is a great way to [...] work on server-side files without laggy typing or manual copying

This is the usecase mentioned in the article and it wouldn't work with a bare repo. But if the server your SSH'ing to is just a central point to sync code across machines, then you're right: multiple hoops mentioned in the article are solved by having the central repo bare.

liveoneggs•1h ago
yeah it seems odd that they don't just have remote> $HOME/repos/foo.git and then clone from there locally and remotely
seba_dos1•1h ago
FWIW a single user working on a remote versioned directory is indeed a reasonable use-case for receive.denyCurrentBranch=updateInstead, but IMO the article should have made it clear that it's not necessarily a good choice in general.
ninkendo•2h ago
I remember the first time I tried git, circa 2006, and the first 3 commands I tried were:

    git init
    git commit -am Initial\ commit
    git clone . ssh://server/path/to/repo
And it didn’t work. You have to ssh to the remote server and “git init” on a path first. How uncivilized.

Bitkeeper and a few other contemporaries would let you just push to a remote path that doesn’t exist yet and it’d create it. Maybe git added this since then, but at the time it seemed like a huge omission to me.

seba_dos1•1h ago
Hah, you made me check whether clone's second argument can be a URL. But no, it's explicitly "<directory>", so it can't be used as a equivalent of "git push --mirror" :)
1oooqooq•2h ago
this article is very bad advice. this way things are extremely brittle and there's a reason all those settings are disabled by default. you will lose data, save from very specific use cases

the vastly superior way is 'git bare' which is a first class supported command without hacky settings.

ezst•2h ago
As a git user "not by choice" (my preference going for mercurial every single day), I never understood why git needs this distinction between bare/non-bare (or commit vs staging for that matter). Seems like yet another leaky abstraction/bad design choice.
skydhash•2h ago
A repo is as database containing a tree of commits. Then you got the concept of branch, which points to a specific commit. Then there's the special pointer HEAD which is the latest commit for the current worktree.

When you checkout (now switch) a branch, HEAD is now the same as the branch (they point to the same commit). When you do operation like commit, reset, reset,... both the head and the branch are updated. So if a remote node tries to update the local node via a push on its end, that would mess up the local worktree. So you create a bare repo instead which can't contain a local worktree.

Note: A worktree is computed from the initial commit to the commit currently identified by HEAD by following the parent information on each commit.

The staging area is like a stored snapshot of what you would like to commit. You can always create patch between HEAD and the worktree, edit it, and then save the patch as the commit, then apply the leftover to the worktree. The staging just make that easier. It's a WIP patch for the next commit.

seba_dos1•1h ago
> When you checkout (now switch) a branch, HEAD is now the same as the branch (they point to the same commit).

Actually, HEAD now points to that branch, which in turn points to the commit. It's a different state than when HEAD points directly to the same commit (called "detached HEAD" in Git's terminology) where this issue doesn't happen as you're not on a branch at all. It's a subtle, but important distinction when trying to understand what happens under the hood there.

skydhash•1h ago
You're right. I was trying to simplify.
DrinkyBird•1h ago
Mercurial has no distinction between a bare repo and a non-bare repo: any repo can have a working copy or not. You can check out a working copy with `hg update somerevision`, or get rid of it with `hg update null`.

You can push to a repo with a working copy, if you like; nothing will happen to that working copy unless you run `hg update`. Since you don’t need a working copy on the server’s repo, you never run `hg update` on it, and it’s effectively what git calls a bare repository.

ezst•9m ago
So, exactly as DrinkyBird said: I still don't see a good reason for this distinction to exist, what's in the repo's history and in its working directory are orthogonal concepts that are tied together by a bad UX for no apparent gain.
rester324•2h ago
Yeah, I am in the same boat. My files are either non-staged or committed about 99.99% of the time. For me the concept of staging is completely useless
mbork_pl•50m ago
Staging is immensely useful in more than one case.

Case one: WiP on a branch, code is pretty stable, but I want to do some experiments which will likely be deleted. I stage everything and then make (unstaged) changes which I can then undo with two keystrokes.

Case two: I'm reviewing a complex PR, so I first merge it with --no-commit, then unstage everything and then stage chunks (or even individual lines) I have already reviewed.

Case three: I was coding in the state of flow and now I have a lot of changes I want to commit, but I want to separate them into several atomic commits. I stage the first batch of changes, commit, then stage another, commit, etc.

There are probably more, but these three alone are worth having the staging area.

ezst•1m ago
Though I wasn't trying to say that there is no need for staging-based workflows, I was just saying that there is nothing in terms of convenience or capabilities that the staging area does that can't be achieved with just regular commits and amending/rewriting.

The immediate response from many git users when confronted to alternative VCSes is "well, it doesn't have a staging area, so it's obviously inferior" instead of going with "let's see how differently they approach this problem, and perhaps I will like it/git isn't all perfect after all".

bitbasher•2h ago
I have been doing this for many years.

If you want a public facing "read only" ui to public repositories you can use cgit (https://git.zx2c4.com/cgit/about/) to expose them. That will enable others to git clone without using ssh.

I keep my private repositories private and expose a few public ones using cgit.

max_•2h ago
I tried this and it is never as smooth as described.

Why is GitHub popular? its not because people are "dumb" as others think.

Its because GitHub "Just Works".

You don't need obscure tribal knowledge like seba_dos1 suggests [0] or this comment https://news.ycombinator.com/item?id=45711294

The official Git documentation for example has its own documentation that I failed to get work. (it is vastly different from what OP is suggesting)

The problem with software development is that not knowing such "tribal knowledge" is considered incompetence.

People don't need to deal with obscure error messages which is why they choose GitHub & why Github won.

Like the adge goes, "Technology is best when it is invisible"

[0] https://news.ycombinator.com/item?id=45711236

[1] https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-...

seba_dos1•2h ago
Are basic git concepts like bare repos "obscure tribal knowledge" these days? What do you think ".git" directory is?
max_•2h ago
Having to make a repo bare to not have issues with branches is definitely obscure.
jdboyd•2h ago
It wasn't obscure before GitHub.

Still, I like the online browser, and pr workflow.

zenmac•2h ago
Yeah this is the best arguments for GitHub type of web git GUI. Not knowing bare repo seems just like a devs not reading docs. And I'm sorry in this day and age devs needs to keep up and just type git like curl http://...../install.sh type of thing.

However would NEVER trust Github since the MS acquisition. codeberg and https://forgejo.org are perfectly sound FOSS alternative to GitHub and GigLabs nowdays.

seba_dos1•2h ago
It's obvious as soon as you consider that your push will overwrite a ref that's currently checked out in the target's repo workdir. The exact same thing happens when pushing to local repos. You don't have to make a repo bare to avoid this issue, but it's certainly the easiest way to avoid it altogether when you don't need a workdir on the server side.
Dylan16807•1h ago
It's obvious that it needs to update the ref. It's not obvious that this would cause any problems. You could fix HEAD as part of writing the ref. Automatically managing HEAD is normal git behavior.
seba_dos1•1h ago
It's obvious that something non-obvious would have to happen with the workdir behind the user's back. Imagine that you are working with your workdir while someone else pushes something to your repo. Bailing out is the only sane option (unless something else has been explicitly requested by the user).
Dylan16807•1h ago
Nothing has to happen to the workdir if you fix HEAD.
seba_dos1•1h ago
...except of all the things that rely on the HEAD pointing to another ref now changing their behavior. gbp will by default bail off if HEAD is not on a branch, "git commit" won't update the ref you thought it will cause you're now suddenly on "detached HEAD" etc.
Dylan16807•1h ago
I've never heard of... debian package builder? I don't care if it gets annoyed; if that's one of the biggest issues then that's a good sign for the method.

Yes the commit won't be on the branch you want, but you'd get about the same issue if the two repos had a bare upstream. The branch diverges and you need to merge. It's a bit less ergonomic here but could be improved. Git could use branch following improvements in general.

seba_dos1•1h ago
> Yes the commit won't be on the branch you want, but you'd get about the same issue if the two repos had a bare upstream.

Not at all. The commit would have "landed" on the exact branch you thought it will. How it will be reconciled with a diverged remote branch is completely orthogonal and may not even be of concern in some use cases at all.

Dylan16807•1h ago
The situation is almost identical except you don't have a cute name for your new commit. Let's say you add a ref to your detached commit, perhaps local/foo. Then you're looking at a divergence between foo and local/foo. If you had a bare upstream it would be a divergence between origin/foo and foo. No real difference. And if you don't want to reconcile then you don't have to.

If git was a tiny bit smarter it could remember you were working on "foo" even after the ref changes.

seba_dos1•12m ago
Of course it could, but that doesn't yet mean it should. A checked-out ref is considered to be in-use and not to be manipulated (unless done in tandem with HEAD), not just by "git push" but also other tools like "git branch". It's consistent and, IMO, less surprising than what you propose. It could be an optional behavior configured by receive.denyCurrentBranch, though I don't see a good use-case for it that isn't already handled by updateInstead.
have_faith•2h ago
The vast majority of developers working with git daily don’t know what a bare repo is, or that it exists at all. It’s not obscure knowledge as such, it’s just never come up for them as something they need.
seba_dos1•2h ago
The vast majority [0] of developers working with git daily have no mental model of git repos and just do a mental equivalent of copy'n'pasting commands and it's enough to let them do their work (until something breaks at least), so it doesn't seem like a particularly good indicator of whether something is obscure or not. There are many obscure things hiding in git, bare repos aren't one of those :)

[0] Source: pulled out of my arse.

general1465•1h ago
Now try to add a submodule X (which is a bare repository) to your repository Y

Good job, now you can't add it nor remove it, without manually removing it in .git folder.

myaccountonhn•2h ago
The cool thing is that once you know how simple it is to self host (I certainly didn't know before, just used github), you learn a skill that you can apply to many different contexts, and understand better what actually goes on in systems you depend on. That's what these "tech should be invisible" people miss, where they tout that you should instead learn SASS solutions where you have zero ownership nor agency, instead of taking the time to learn transferable skills.
blueflow•2h ago
> obscure tribal knowledge

The knowledge is neither obscure nor tribal, it is public and accessible. And likely already on your system, in the form of man-pages shipped with your git binaries.

> The problem with software development is that not knowing such "tribal knowledge" is considered incompetence.

Consequently.

croes•2h ago
> Technology is best when it is invisible

For normal users. Having this tribal knowledge is basically what makes developer and it’s their job to make technology invisible for others. Someone has to be behind the curtain.

vaylian•2h ago
> Its because GitHub "Just Works".

IPv6 still doesn't work with GitHub: https://doesgithubhaveipv6yet.com/

Dylan16807•2h ago
People use github because it has a bunch of features outside git and because they don't already have a server.

Not because it's hard or obscure to put git on your server.

motorest•1h ago
> I tried this and it is never as smooth as described.

I think your comment shows some confusion that it's either the result or cause of some negative experiences.

Starting with GitHub. The primary reason it "just works" is because GitHub, like any SaaS offering, is taking care of basic things like managing servers, authorization, access control, etc.

Obviously, if you have to setup your own ssh server, things won't be as streamlined as clicking a button.

But that's obviously not the point of this post.

The point is that the work you need to do to setup a Git server is way less than you might expect because you already have most of the things already set, and the ones that aren't are actually low-hanging fruit.

This should not come as a surprise. Git was designed as a distributed version control system. Being able to easily setup a stand-alone repository was a design goal. This blog post covers providing access through ssh, but you can also create repositories in any mount point of your file system, including in USB pens.

And, yes, "it just works".

> The official Git documentation for example has its own documentation that I failed to get work. (it is vastly different from what OP is suggesting)

I'm sorry, the inability to go through the how-to guide that you cited has nothing to do with Git. The guide only does three things: create a user account, setup ssh access to that account, and create a Git repository. If you fail to create a user account and setup ssh, your problems are not related to Git. If you created a user account and successfully setup ssh access, all that is missing is checking out the repo/adding a remote repo. If you struggle with this step, your issues are not related to Git.

bitbasher•1h ago
I understand where you're coming from, but this seems like a terrible defeatist attitude to have.

What are we supposed to do ... throw our hands up because GitHub won?

I'll be down voted, but I'll say it. If you hold that attitude and you don't learn the fundamentals, if you don't understand your tools, you're a bad developer and a poor craftsman. You're not someone I would hire or work with.

Tomis02•1h ago
git is not "the fundamentals". It's a tool that's very difficult to learn but we are forced to use because "it won" at some point.

Git's difficulty is NOT intrinsic; it could be a much better tool if Torvalds were better at UX. In short, I don't blame people who don't want to "learn git". They shouldn't have to learn it anymore than one learns to use a browser or Google docs.

bitbasher•1h ago
Git isn't fundamental, but version control is. If you're doing development without it, you're making a mistake.

You're likely using a VCS, which is likely git (or jj, hg, fossil, tfs, etc).

Therefore, you should know how to use whatever you're using. It shouldn't be "invisible" to you.

imiric•1h ago
> Why is GitHub popular? its not because people are "dumb" as others think.

> Its because GitHub "Just Works".

Git also "just works". GitHub simply offers a higher level of abstraction, a graphical UI, and some value-add features on top of Git. How much better all this really is arguable. I would say that it's disastrous that most developers rely on a centralized service to use a distributed version control system. Nevermind the fact that the service is the single largest repository of open source software, owned and controlled by a giant corporation which has historically been hostile to OSS.

GitHub "won" because it came around at the right time, had "Git" in its name—which has been a perpetual cause of confusion w.r.t. its relation with Git—, and boosted by the success of Git itself largely due to the cult of personality around Linus Torvalds. Not because Git was technically superior, or because GitHub "just works".

> You don't need obscure tribal knowledge

As others have said, a bare repository is certainly not "tribal knowledge". Not anymore than knowing how to use basic Git features.

> Like the adge goes, "Technology is best when it is invisible"

Eh, all technology is an abstraction layer built on top of other technology. Whether it's "invisible" or not depends on the user, and their comfort level. I would argue that all abstractions also make users "dumber" when it comes to using the layers they abstract. Which is why people who only rely on GitHub lose the ability, or never learn, to use Git properly.

herpdyderp•1h ago
> Its because GitHub "Just Works".

Unfortunately (though expected), ever since Microsoft took over this has devolved into GitHub "sometimes works".

throwaway106382•1h ago
God forbid we learn how our tools work.
jrm4•41m ago
It is "incompetence," or at the very least, it is unwise.

At the very least, a huge part of the intent of Git's very design was decentralization; though as is the case with many good tools, people don't use them as they are designed.

Going further, simply because "deeply centralized Git" is very popular, does not AT ALL determine that "this is the better way to do things." Please don't frame it as if "popular equals ideal."

johnisgood•2h ago
I am surprised how little software engineers (even those that use) know about git.
general1465•1h ago
That's because git is hard to use and full of commands which are making no sense. Eventually people will learn to just clone, pull, push and occasionally merge and be done with it.
skydhash•1h ago
Most people would just use `app` `app (final)`, `app (final 2)`, etc... VCS exists for a reason and I strongly believe that the intersection of people that say git is hard and people that do not know why you want a VCS is nearly a perfect circle.
jonhohle•41m ago
People said the same thing about “advanced” operations with cvs and svn (and just called their admin for p4 or source safe). But I really don’t understand the sentiment.

Managing code is one of the cornerstones of software engineering. It would be like refusing to learn how to use a screwdriver because someone really just wants to hammer things together.

The great thing about $your-favorite-scm is that it transcends language or framework choices and is fungible for early any project, even outside of software. I’m surprised it isn’t part of more professional tools.

timmg•2h ago
There was a brief period when Google Cloud had support for hosting git on a pay-per-use basis. (I think it was called Google Cloud Repositories.) It had a clunky but usable UI.

I really preferred the idea of just paying for what I used -- rather than being on a "freemium" model with GitHub.

But -- as many things with Google -- it was shutdown. Probably because most other people do prefer the freemium model.

I wonder if this kind of thing will come back in style someday, or if we are stuck with freemium/pro "tiers" for everything.

XorNot•1h ago
My git "server" is a folder of bare git repositories in home directory which I share with Syncthing.

It'd be great if there was more specific support. But in practice? No problems so far.

eqvinox•1h ago

  git clone ssh://username@hostname/path/to/repo
this is equivalent to:

  git clone username@hostname:path/to/repo
and if your usernames match between local and remote:

  git clone hostname:path/to/repo
(if the path has no leading /, it is relative to your home directory on the remote)
blueflow•1h ago
Docs:

https://git-scm.com/docs/git-clone#_git_urls

https://git-scm.com/docs/git-init

globular-toast•1h ago
The proper way to do this to make a "bare" clone on the server (a clone without a checked out branch). I was doing this in 2010 before I even signed up to GitHub.
jonhohle•1h ago
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 the same remotes by changing fetch and push paths. At one company it was common to push back to `$user/$feature` to avoid polluting the root namespace with personal branches. It was also common to have `backup/$user` for pushing having a backup of an entire local repo.

I often add a hostname namespace when I’m working from multiple hosts and then push between them directly to another instead of going back to a central server.

For a small static site repo that has documents and server config, I have a remote like:

    [remote “my-server”]
    url = ssh+git://…/deploy/path.git
    fetch = +refs/heads/*:refs/remotes/my-server
    push = +refs/heads/*:refs/remotes/my-laptop
So I can push from my computer directly to that server, but those branches won’t overwrite the server’s branches. It acts like a reverse `git pull`, which can be useful for firewalls and other situations where my laptop wouldn’t be routable.
Sharlin•1h ago
Git was always explicitly a decentralized, "peer to peer" version control system, as opposed to centralized ones like SVN, with nothing in the protocol itself that makes a distinction between a "server" and a "client". Using it in a centralized fashion is just a workflow that you choose to use (or, realistically, one that somebody else chose for you). Any clone of a repository can be a remote to any other clone, and you can easily have a "git server" (ie. just another directory) in your local filesystem, which is a perfectly reasonable workflow in some cases.
webstrand•1h ago
It's a little more complex than that. Yes git can work in a peer-to-peer fashion, but the porcelain is definitely set up for a hub-and-spoke model, given how cloning a remote repo only gives you a partial copy of the remote history.

There's other stuff too, like git submodules can't be configured to reference another branch on the local repository and then be cloned correctly, only another remote.

isaacremuant•57m ago
I'd say git submodules have such an awkward UX that should probably not be used except in very rare and organized cases. I've done it before but it has to be worth it.

But I get your larger point.

jonhohle•56m ago
> given how cloning a remote repo only gives you a partial copy of the remote history

When you clone you get the full remote history and all remote branches (by default). That’s painfully true when you have a repo with large binary blobs (and the reason git-lfs and others exist).

Sophira•46m ago
> given how cloning a remote repo only gives you a partial copy of the remote history

You may be thinking of the optional -depth switch, which allows you to create shallow clones that don't have the full history. If you don't include that, you'll get the full history when cloning.

jonhohle•58m ago
This is a better summary than mine.

There was a thread not to long ago where people were conflating git with GitHub. Git is an incredible tool (after coming from SVN/CVS/p4/source safe) that stands on its own apart from hosting providers.

Sharlin•47m ago
And GitHub naturally has done nothing to disabuse people of the interpretation that git = GitHub. Meanwhile, the actual raison d'etre for the existence of git of course doesn't use GitHub, or the "pull request" based workflow that GitHub invented and is also not anything intrinsic to git in any way.
JamesLeonis•10m ago
I have a use case just for this. Sometimes my internet goes down while I'm working on my desktop computer. I'll put my work in a branch and push it to my laptop, then go to a coffee shop to continue my work.
webstrand•1h ago

    git clone --mirror <remote> 
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.

Cheer2171•54m ago
> It doesn't include pull requests, when cloning from github, though.

Because GitHub pull requests are a proprietary, centralized, cloud-dependent reimplementation of `git request-pull`.

How the "free software" world slid head first into a proprietary cloud-based "open source" world still boils my blood. Congrats, Microsoft loves and owns it all, isn't that what what we always wanted?

seba_dos1•46m ago
They are available as refs on the remote to pull though, they just aren't listed so don't end up mirrored either.
masklinn•41m ago
They are listed tho. You can very much see them in info/refs.
seba_dos1•34m ago
My bad! I got misled by grandparent - they are in fact mirrored with "git clone --mirror" as well.
kawsper•46m ago
I always thought it would have been better, and less confusing for newcomers, if GitHub had named the default remote “github”, instead of origin, in the examples.
masklinn•45m ago
How is it less confusing when your fork is also on github?
tobylane•22m ago
If I clone my fork, I always add the upstream remote straight away. Origin and Upstream could each be github, ambiguous.
tangotaylor•1h ago
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.

jonhohle•48m ago
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 painless deployment.

Since the web root is already a sub directory, more sensitive things can go into the same repo without worrying about exposing them.

binary132•1h ago
This is definitely nice but it doesn’t really support the full range of features of Git, because for example submodules cannot be local references. It’s really just easier to set up gitolite and use that in almost the same exact way but it’s much better.
mberning•1h ago
I do something similar. I create a bare repo on my dropbox folder or nas mount. Then checkout from bare repo file path to some place where I will be doing all the work.
prmph•48m ago
The more I use git, the more I discover more depth to it.

So many features and concepts; it's easy to think you understand the basics, but you need to dig deep into it's origin and rationale to begin to grasp the way of thinking it is built around.

And the API surface area is much larger than one would think, like an iceberg

So I find it really weirdly low level in a way. Probably what is needed is is a higher-level CLI to use it in the most sensible, default way, because certainly the mental model most people use it with is inadequate.

jrm4•45m ago
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.

morshu9001•36m ago
Idk if git was designed to not be used in a centralized way. Like all other common CLIs, it was simply designed to work on your PC, and nothing stopped a corp from turning it into a product. Torvalds made git and Linux, then he put Linux on Github.