woockashek
woockashek

Reputation: 1628

Add remote to origin

I'm looking for an option to push my remote configuration to origin. Locally I have 2 remote sources I work with. I would like to push this information to our origin so the fresh clone from origin will contain both remotes. Is that possible?

local repository my_repo:

git remote add remote2 http://some-url.git
# magic command here

fresh repository my_repo:

git clone my_repo
cd my_repo
git fetch remote2

Upvotes: 0

Views: 139

Answers (2)

jsageryd
jsageryd

Reputation: 4635

Git has no built-in functionality to push its configuration between repositories.

Upvotes: 1

Simone
Simone

Reputation: 21262

I don't think Git has any option to add remotes automatically.

You could probably write a script to add the remote2 folder in .git/refs/remotes/, or you could simply ask your repository's collaborators to add the new remote manually. It's very straightforward:

git remote add remote2 http://some-url.git
git fetch remote2

Upvotes: 2

Related Questions