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?
There are two ways to create a bare Git repo: Clone an existing repository with the git clone –bare switch. Create a new bare git repo with the git init –bare switch.
git init : One Person Starting a New Repository Locally First, initialize the repository and make at least one commit. Once you have initialized the repository, create a remote repository somewhere like GitHub.com. Then, add the remote URL to your local git repository with git remote add origin <URL> .
A bare Git repository is typically used as a Remote Repository that is sharing a repository among several different people. You don't do work right inside the remote repository so there's no Working Tree (the files in your project that you edit), just bare repository data.
So, whether you decide to share your code with a team via a server or use it to manage your code locally, your repository looks the same. So, that's why you can use Git without GitHub: Git works as a standalone tool or with a server. Let's talk about Git's version-control features.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With