Search code examples
gitgit-pushgit-remote

How to push code to different projects repos?


I'm working for 3 different clients now and I need to push the code to they repos. I was thinking that if I change the working directory it allow me to set new remote origin. But after executing this command git remote I see the old remote.

How to set different remotes for different clients? Thank you in advance!

P.S I have one account on bitbucket with privileges to read and write to clients repos.


Solution

  • Just add one remote for each client

    git remote add client1 path-to-repo-client1
    git remote add client2 path-to-repo-client2
    # then you can do stuff
    git push client1 branch-client1
    git push client2 branch-client2