4 ms·
if it's for personal use and no access rights are needed, just use ssh. If you need to add more people, but don't require access right for the git repos (i.e.
by iveqy 4y ago
if it's for personal use and no access rights are needed, just use ssh.
If you need to add more people, but don't require access right for the git repos (i.e. everyone will be able to force push). Still use ssh, but create a git user and git-shell as the shell to improve security.
If you want to go one step up, I was looking at soft-serve, however it's too immature yet. So I added a git-shell-commands folder and added list command that will list my git repos.
It's really simple!
If you need access rights and reviews, things will be a bit more complicated. Although git-shell seems pretty easy to add some access rules to, if not gitolite is better. For browsing, cgit and gitweb should be obvious choices, however I don't really see the point for a minor site.
For code review, I'm really voting for git-appraise to take off. Once I get a coworker, that's what we will be using.
- jason_slack 4y ago> reviews Are you saying that I can self-host and have the same "review" functionality as GitHub when reviewing PR's?
- capableweb 4y ago> if it's for personal use and no access right are needed, just use ssh. This! I think many people don't realize how easy it is to host git repositories over just pure ssh. I backup all my git repositories this way, and also have a usb disk drive with backups (which is super easy to setup, just add a git remote with a unix path to where you wanna send it). Each repository I have have three remotes (`origin` which is usually GitHub/Codeberg, `ssh` which is my remote backup and `usb` which is my disk drive). My alias `gp` pushes the current branch to all three simultaneously.
- teekert 4y agoDo you mean use VSCode with Remote-SSH and just work on a server?
- mprime1 4y agoNo I think OP means log in to your server via SSH, ‘git init —bare’ and you’re done. You’re now self hosting your git “server” without any of the tools listed in this poll.
- whitesilhouette 4y agoWhat you are talking about is remotely accessing and working on a codebase. That has nothing to do with repository management. As mprime1 replied, it's more on the lines of firing up the terminal to create the git repository. Then go back to your local system and git clone/pull the thing. Then you fire up your local VSCode and work on it and then finally push the changes. This way the whole team can work seamlessly and implement CI/CD while addressing conflicts in real time. What you are talking about is a beautiful way to work on a remote machine (especially the headless ones) but only when you are the single dev. For a team, you gotta go the other way.
- teekert 4y agoThanx for the explanation, so if you create the repo on the server, can you just got clone server.ip then? How do you clone it? Does that git init —bare command create a server?
- saurik 4y agogit clone teekert@ssh.example.com:path/like/scp If you also want public access over http you can activate one of the default hooks (so a single "rename a file" command on the server) and then export it using literally any web server software (as it is a folder of dumb files).
- teekert 4y agoAh! Somehow I was assuming some magic in the cloning, some server-client relation. There is not I guess, and that is actually logical. Also refreshing in a way.
- saurik 4y agoFWIW, I do believe that you have to have git installed on the other side, and what it is doing at an implementation level is using ssh to run a transient copy of the git daemon backed by that path on the remote machine, which communicates over stdin/stdout--and so over ssh--and which implicitly (due to the EOF) dies when the ssh connection dies. Like, I don't think it is accessing the remote side using mere scp/sftp file-system operations or anything (which would be horribly slow for a number of basic operations and would make cleanly running triggers and the such more annoying).