Creating a bare repository on a Git server remotel

2020-07-14 09:36发布

问题:

Is there any way to create bare repositories on a Git server remotely from my local machine?

I'm trying to eliminate the annoyance of having to ssh in to my Git server and create the bare repo manually.

It's probably not possible, but ideally I'd like to create local git repositories, and push them straight away to my Git server without having to create bare versions on the server first.

Am I asking too much of Git?

回答1:

I think the best way is through ssh, something like:

$ ssh remoteserver 'git init --bare YOURPATH/REPONAME'

You can configure to use SSH as password-less if you are going to use it lot of times.



标签: git ssh