On Sun, 5 Feb 2017 19:39:14 -0800 (PST) [email protected] wrote: > I intend build a git server on machine with ubuntu server 16 L.T.S. > > I following first step on this article > https://help.ubuntu.com/lts/serverguide/git.html but this is a good > option? I can let it stay like this? > The main user on this machine is "git", obvious after sudo :)
"sudo" is not a user on Unbuntu, but rather a group, members of which may become superusers by means of using the sudo program. > I create directory "repo" on / (slash) and on inside this directory I > created my repository git, e.g. projectone.git. This repository git > has only git:git as user and permission are 700. This is good setup? I'd say this setup is overcomplicated. I assume you have SSH access to that machine as a regular user. If yes, you don't need to have anything special to host your own Git repositories there except for the installed git-core package. All you need to do is to SSH to that machine and run git init --bare ~/myrepo.git then on your local machine you take an existing repository and do something like git remote add server ssh://username@servername/~/myrepo.git git push server master where username is your SSH username on the host servername. IOW, when your local Git instance is told to access a remote Git repository via SSH, that local Git instance spawns an SSH client, logs you in, tell the SSH server to run a special Git command once your remote session is created, and then both Git instances communicate via the tunnel SSH provides. The user name + host name part of the repository URI is used to connect to the remote server while the rest of it -- the path -- is literally interpreted to tell the remote Git instance where the target repository is located. You're hence free to create a dedicated directory for your remote Git repos under your home directory (like ~/devel/myrepo.git) or even create a special directory for them elsewhere (provided you also set proper access permissions on it) though I really don't understand why you'd need to do that if all that you want is having private repositories for your sole user. A dedicated user to host remote Git repositories is not needed. It *may* be needed in special setups where all access to the repos is handled by some front-end software package (such as gitolite or GitLab or Gitblit or gogs or whatnot); in your case Git will be run directly by the SSH server which logged you in -- with your own credentials. -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
