3 ms·
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
by bfkwlfkjf 1y 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 1y 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 1y agoExactly! 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 1y agoAnd in general, any daemon that manipulates files can be replaced by ssh (or ftp) access and a local program. And most things are files.
- tsimionescu 1y agoBTW, a nice example of this general concept is Emacs' TRAMP mode. This is a mode where you can open and manipulate files (and other things) on remote systems simply by typing a remote path in Emacs. Emacs will then simply run ssh/scp to expose or modify the contents of those files, and of course to run any required commands, such as deleting a file.
- liveoneggs 1y agoDid 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---sharedfalsetrueumaskgroupallworldeverybodyperm 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 1y agoNo, you're wrong. These are holes in my ssh knowledge, and your comment makes me think you have the same holes.
- liveoneggs 1y agolol you sound like a treat, dude https://git-scm.com/book/ms/v2/Git-on-the-Server-The-Protocols https://git-scm.com/book/ms/v2/Git-on-the-Server-The-Protoco...
- deleted 1y ago[deleted]
- skydhash 1y agoGit 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 1y 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 1y agoSSH 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 1y agoIt's just a transport, and it needs a server.
- ogig 1y agoYou can think of the ssh://server/folder as a normal /folder. ssh provides auth and encryption to a remote hosted folder but you can forget about it for the purpose of understanding the nature of git model.
- charles_f 1y agoThe server is git itself, it contains two commands called git-receive-pack and git-upload-pack that it starts through ssh and communicate through stdin/out
- Joeboy 1y agoI 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 1y agoYup! Someone else just pointed it out. Brilliant, thank you!