Live data from Hacker News

You already have a Git server

maurycyz.com

81–90 of 454 posts

Re: You already have a Git server

#81
post #9

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 ru…

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.

Re: You already have a Git server

#82
post #38

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…

> 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.

Re: You already have a Git server

#84

I am surprised how little software engineers (even those that use) know about git.

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.

Re: You already have a Git server

#85

  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)

Re: You already have a Git server

#86

Earlier quoted context omitted.

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).

Nothing has to happen to the workdir if you fix HEAD.

...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.

Re: You already have a Git server

#89

Maybe I'm too old, but are there people that really didn't know that any ssh access is sufficient for using git?

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 fo…

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`

Re: You already have a Git server

#90
post #3

Interesting. I am just trying to decide between self-hosting Forgejo and other options for hosting Git in own private network.

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.
Post reply on HN