Share git local repository with other users

Asked

Viewed 3,215 times

0

Is there any way to share my git repository that’s on my computer with other users?

I don’t want to use Github, I just want to share the repository so the other user can see the code and commits.

  • if the repository is local I believe that the only way would be to give access to another person on your computer, if that project was hosted somewhere you could give the access for the person to see the code and the commits, in the case of an eventual commit and push of that person, you could refuse PR (pull request) and the code and commit history would remain the same.

  • I recommend using Bitbucket. It’s free for private repositories and you can easily share them with other users.

1 answer

1

Rather, you need to understand the difference between a repository ( and a workbook (Working directory) and a "null repository" (Bare Repo). When you clone a repository, or start a directory with git init, it is a repository of work. I believe it is what you have on your machine.

The repository is a little different. You can create it on your machine using git init --bare, in another folder. In short, you’ll do all the work in the workbook, then you’ll do push or pull requests to the repository folder.

When someone else wants to work on the project, they will make a clone of the project on their own machine, and they will push or pull requests to your machine, where is the Bare Repos.

A premise of Git is "Everything is local". You don’t share the working directory, but the repository with the history of the changes, Bare Repo.

What is a Bare git Repository?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.