There are several ways to do this
- Host internal repositories like Gitlab (free software) or Stash. This will be similar to services like BitBucket or GitHub
- If you want to have a simple service with SSH authentication - user3159253 has already answered that
- A very bare bones way is
- Create a bare repository - example
git init . --bare
- Start the git daemon - example
git daemon --base-path=<absolute full path to git repo
- Add that repo as
git remote add RepoName git://your.local.host.name/myrepo
or clonegit clone git://your.local.host.name/myrepo/
- Create a bare repository - example