Dung (Donny) Nguyen

Senior Software Engineer

Git - Add More Remote Repositories

1. Open your terminal or command prompt.

2. Navigate to the directory of your local Git repository. Use the cd command to change directories. For example:

   cd path/to/your/repository

3. Add a new remote using the git remote add command. The syntax is:

   git remote add <remote_name> <remote_url>

Example:

   git remote add upstream https://github.com/username/repository.git

4. Verify the added remote. Use the git remote -v command to list all remotes and their URLs:

   git remote -v

This will show a list like:

   origin git@github.com:your_username/your_repository.git (fetch)
   origin git@github.com:your_username/your_repository.git (push)
   upstream https://github.com/username/repository.git (fetch)
   upstream https://github.com/username/repository.git (push)

Now you can interact with the new remote:

Key points:

By following these steps, you can effectively manage multiple remote repositories in your Git workflow.