Add A New Git Remote Repository

Working with different clients I often end up with multiple Git remote repositories. When I start a new project with a client I create the initial repository in my Gitlab called origin and if the time comes I will add another remote repository in the client environment with the name of the client clientABC. This is how to add a new Git remote repository in addition to your default Git repository.

Add the new remote repository using the git remote add command.
git remote add clientABC https://gitlab.com/clientABC/exampl-repo.git

Then when pushing or pulling from the different remote repositories make sure to include the appropriate remote name when running the commands. For example, when pulling from origin dev branch use git pull origin dev. And if you want to push your changes up to the new client remote use git push clientABC dev.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>