0

I have authorization by public_key to remote repo and I can get everything from http://someurl/first.git on my local machine, but I have to populate this changes to other environments. To make it possible I have to put there my private_key, clone repo and switch to specified tag. But I don't want to do it because of security reasons.

I'm thinking about creation of my local repo http://someurl/second.git, committing all changes to it and deploy. But I have now idea how to add remote repo to my local? Is it possible? And how to commit to my local repo from remote and switch to needed tag?

CharlesB
  • 86,532
  • 28
  • 194
  • 218
Viacheslav Kondratiuk
  • 8,493
  • 9
  • 49
  • 81
  • 2
    What do you mean by "populate this changes to other envioronments"? What is this "local repo" you're talking about in "I'm thinking about creation of my local repo http://someurl/second.git, commiting all changes to it and deploy"? Deploy to where? You need to reword this question, I can't understand what you're trying to say. In general, adding a new remote can be done using the `git remote add` command - `git remote add second http://someurl/second.git` but I'm not sure this is what you're looking for. – Noufal Ibrahim Sep 19 '12 at 15:59
  • Woudn't simply generating a different public/private key pair that's only used for distributing from the central repo to the others solve the "security reasons"? – twalberg Sep 19 '12 at 16:10

1 Answers1

1

Noufal Ibrahim should post his comment as an answer :

Use git remote add to register a new remote repository, e.g. :

git remote add site2 http://someurl/second.git

After that, you can push from your local machine to this other repository :

git push site2 myBranch
Community
  • 1
  • 1
LeGEC
  • 46,477
  • 5
  • 57
  • 104