copolii
copolii

Reputation: 14506

Can I add a git remote for all users?

The company has just switched to git and there are a few github repos that we use in our projects.

What I'd like to do is to have a few local repos, which pull from the said github repos. The reason is that (for obvious reasons) I want everyone building the project to be using the same revision of LIB_A (as opposed to each user being on a different revision of it depending on when they last fetched).

I've added the upstream repo locally to my own clone, now is there a way to push this remote up to the central repo so that everyone can pull from github and update our central repo?

This is slightly easier than having everybody add the remote.

Upvotes: 1

Views: 167

Answers (1)

Adam Dymitruk
Adam Dymitruk

Reputation: 129564

As mentioned in the comment, you should be using submodules. What submodules do is that they not only point to another repository, but also "freeze" which commit this repository is at according to the containing repository. Have a read of Chapter 6 in the progit.org/book.

Upvotes: 2

Related Questions