1

I'm not a git expert, so this question might sound either trivial or no sense. I was wondering if it is possible to create a repository in a local machine and give access to such repository using ssh.

The idea would be not using anything remote, but just provide access to a few colleagues/friends who wish to try my code.

Is this possible?

I should also clarify that the purpose of this is to allow my colleagues to access my code, so it cannot be stored in a personal repository since would be company related, despite it's not part of any project.

user8469759
  • 2,522
  • 6
  • 26
  • 50
  • 1
    Possible duplicate of [Free GIT Server with Web GUI a la BitBucket/GitHub](https://stackoverflow.com/questions/44239764/free-git-server-with-web-gui-a-la-bitbucket-github) – phd Jul 08 '18 at 18:40
  • If your colleagues/friends are accessing it from your computer, then I'm afraid that this is considered "remote", even if only on the local network. – snoopy Jul 09 '18 at 04:00

3 Answers3

0

The idea would be not using anything remote, but just provide access to a few colleagues/friends

From your friends point of view your local repository is kinda remote resource.

Is this possible?

It is not possible with git unless you setup a remote repository your friends can clone from, but your operating system can provide access for your friends to the directory where you store your code.

Timothy Truckle
  • 15,071
  • 2
  • 27
  • 51
0
git clone ssh://example.com/srv/git/repo 

You need to setup SSH server (SSH daemon) and have SSH installed on the client (e.g. PuTTY on MS Windows).

You can also upload the git repo to GitLab, you can set the repo as Private and give the access only to your colleagues/friends.

Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114
0

You need to set up a git daemon. Details on how to do this vary on the OS you are using, which you did not disclose. For Linuxes, there are git-daemon-* packages ready for use. For Windows, have a look at How to start git daemon on Windows or ask your favorite search engine for git daemon windows.

Adrian W
  • 4,563
  • 11
  • 38
  • 52