Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 3
Message 1 of 4

Trying to understand remote repos

Solved! Go to Solution.

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".
Since I am new, I am not sure what is the team behaviour pattern here, maybe you could advice on that.

The section of the official git manual that got me confused is the following:

remotegit.png

1. Looking at their example of some 'git remote' output, I can see that there's:
URL/schacon/ticgit
URL/paulboone/ticgit
* What does that mean? That there are two different repos named samely ("ticgit")?
* Why would a team work like that?

2. I am only able to do 'git remote' within an existing repo, isn't that a little diminishing the usefullness of 'git remote add', as (I think) it means that the remote aliases are only defined for each local repo?

 

3. In the example provided, they are defining an alias for ".../schacon/ticgit" but when I want to clone a repo that's hosted in the cloud, the command I am told to copy-paste is more like: .../schacon/ticgit.git
* Shouldn't the manual tell us to refer to the full address (all the way including ticgit.git)?

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!

3 Replies
Solution
Copilot Lvl 3
Message 2 of 4

Re: Trying to understand remote repos

To answer all your questions one by one:

 


@DraxDomax wrote:

1. Looking at their example of some 'git remote' output, I can see that there's:
URL/schacon/ticgit
URL/paulboone/ticgit
* What does that mean? That there are two different repos named samely ("ticgit")?
* Why would a team work like that?


 

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.

 


@DraxDomax wrote:

2. I am only able to do 'git remote' within an existing repo, isn't that a little diminishing the usefullness of 'git remote add', as (I think) it means that the remote aliases are only defined for each local repo?


 

Yes, remotes only work inside git repositories, since a single remote always points to a single repository.

 


@DraxDomax wrote:

3. In the example provided, they are defining an alias for ".../schacon/ticgit" but when I want to clone a repo that's hosted in the cloud, the command I am told to copy-paste is more like: .../schacon/ticgit.git
* Shouldn't the manual tell us to refer to the full address (all the way including ticgit.git)?


 

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!

 


@DraxDomax wrote:

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?


 

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!:

Copilot Lvl 2
Message 3 of 4

Re: Trying to understand remote repos

Wow.

 

The Git Flow link is fantastic.  Very clear explaination of how a team should work.

Copilot Lvl 3
Message 4 of 4

Re: Trying to understand remote repos

How can I possibly thank you more than just saying that this was an amazing interaction for me to read your insight?