Live data from Hacker News

You already have a Git server

maurycyz.com

111–120 of 454 posts

Re: You already have a Git server

#111

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

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.

Re: You already have a Git server

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

Re: You already have a Git server

#113

Earlier quoted context omitted.

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…

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

You're right. I was trying to simplify.

Re: You already have a Git server

#114
post #21

Earlier quoted context omitted.

Yup. I’ve heard several people say that Git is a product from Microsoft…

The irony, when you realize that Linus Torvalds created git.

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

Re: You already have a Git server

#115

Earlier quoted context omitted.

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

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…

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

Re: You already have a Git server

#116

Earlier quoted context omitted.

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…

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

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.

Re: You already have a Git server

#117

Earlier quoted context omitted.

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.

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.

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.

Re: You already have a Git server

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

Re: You already have a Git server

#119

Earlier quoted context omitted.

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

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…

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.

Re: You already have a Git server

#120
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…

God forbid we learn how our tools work.
Post reply on HN