2

I have a remote linux machine with only one user.

I just set up git repos on it without a git user. But all the tutorials suggest me to use the git user. So right now I am using

git clone user@hostname:/path/to/git/directory/your_project.git 

rather than :

git clone git@hostname:/path/to/git/directory/your_project.git

And it works fine.

If I use the git account, for each project I have to change permission for that project and change the config to share the directory.

Does using the setting up and using a git user have any advantage over using your user account on linux?

snugghash
  • 450
  • 3
  • 13
  • 2
    It's generally best practice to create a new user for most services, most of the time. Rather than have every service run as "root", or some other "god user". Q: It sounds like your particular case is different: you're not "root", and you're running git more or less as a "personal" service? Correct? In which case, sure: whatever is most convenient for you. – paulsm4 Aug 20 '18 at 04:53
  • @paulsm4 Thanks mate.... I just wanted to make sure it was a secure option and yes, I am trying to use it as a more personal service – A Nerd Has No Name Aug 27 '18 at 18:49

1 Answers1

2

Not much, maybe convention - git automation tools and APIs might expect a git user, but I've never come across such a situation.

Sources: https://git-scm.com/book/en/v1/Git-on-the-Server-The-Protocols and https://www.digitalocean.com/community/tutorials/how-to-set-up-a-private-git-server-on-a-vps

The second one describes the creation of a git user, and then you get the URLs (over SSH, using a SCP-like syntax, as referenced in the first article's second method) to be git@server:.

You've essentially done the same thing but with whatever user instead of a user named git, so you get user@server:

snugghash
  • 450
  • 3
  • 13