Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a remote server on LAN instead of using GitHub? [closed]

Can I create my own remote server instead of using GitHub?

i.e Can I make a remote server on LAN where 3 computers are sharing a drive on a network to do the collaborative work using Gitbash?

like image 278
Umair Cheema Avatar asked Jan 22 '14 03:01

Umair Cheema


People also ask

How do you make local repository as remote?

Adding a remote repository To add a new remote, use the git remote add command on the terminal, in the directory your repository is stored at. The git remote add command takes two arguments: A remote name, for example, origin.

Does GitHub work in remote or local level?

GitHub is a remote hosting system for sharing repos. You can use Git independently on your local machine and never share your work or use GitHub. Alternately, you can use Git to directly collaborate with others without using a shared hosting system like GitHub.

Can Git remote be local?

Git remote is just a connection between the local and GitHub repository. Since GitHub repositories contain twisted URLs that one cannot remember for every repository, we provide names to those links to remember. We use git remote for the same.


2 Answers

Yes, you do. Actually you need a SSH-service and git would perfectly work over SSH. Since you're on Windows, see Setup a Git server with msysgit on Windows

like image 109
user3159253 Avatar answered Oct 13 '22 23:10

user3159253


There are several ways to do this

  1. Host internal repositories like Gitlab or Stash. This will be similar to services like BitBucket or GitHub
  2. If you want to have a simple service with SSH authentication - user3159253 has already answered that
  3. A very bare bones way is
    1. server: Create a bare repo: mkdir -p RepoName && git init RepoName --bare
    2. server: Start the git daemon: git daemon --base-path=$PWD/RepoName
    3. client:
      Add your remote: git remote add origin git://server.url.or.ip/RepoName
      or just clone it: git clone git://server.url.or.ip/RepoName
like image 26
First Zero Avatar answered Oct 13 '22 22:10

First Zero