Trying to understand remote repos #22985
-
Hi, I have been using git as a local VCS for a little and now reading up on how to enable collaboration with the rest of the team. I think we’ll be using “remote repo”. The section of the official git manual that got me confused is the following:
I thought there can be only one repo hosted online and all users have a clone locally that they modify and stage to commit to the one that’s in the cloud… Or I am totally missing the way git is used with a cloud distribution server? Kudos and thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
To answer all your questions one by one:
The depicted set of repositories probably is displaying a fork-kind of nature here. So user “paulboone” might have forked off ticgit into his own repository to do a larger set of changes without having direct contribution rights to "schacon"s ticgit. I’m not sure if teams would directly work like this, forking a core repository, but rather be used in the open source world and on GitHub moreso.
Yes, remotes only work inside git repositories, since a single remote always points to a single repository.
This depends on the server that is serving the git repositories, but usually the “.git” can be omitted! You can try this on GitHub, taking any repository path to clone and removing the “.git” part at the end, it still works!
There are many different ways to use git. Technically, you could, as you describe, put a single bare git repository on a server and have users clone that one and push their changes to it! In most cases though, people use systems like GitHub, GitLab or Bitbucket to host their repositories, and of course that allows more than a single repository to exist, but depending on project-scale or teams, one repository might be enough! If you need advice for teams and appropriate workflows, I recommend you to check out these two workflows that have been widely adopted by teams all over the globe!: |
Beta Was this translation helpful? Give feedback.
-
How can I possibly thank you more than just saying that this was an amazing interaction for me to read your insight? |
Beta Was this translation helpful? Give feedback.
-
Wow. The Git Flow link is fantastic. Very clear explaination of how a team should work. |
Beta Was this translation helpful? Give feedback.
To answer all your questions one by one:
The depicted set of repositories probably is displaying a fork-kind of nature here. So user “paulboone” might have forked off ticgit into his own repository to do a larger set of changes without having direct contribution rights to "schacon"s ticgit.
I’m not sure if teams would directly work like this, forking a core repository, but rather be used in the open source world and on GitHub moreso.