Hello, Visitor
Push your project in multiple git repositories at a time

Push your project in multiple git repositories at a time

MORE GITHUB

Hello friends, today in this blog you’ll learn how to push a project in multiple git repositories at a time in one git push command.

Pushing a project in multiple repositories means, suppose you have a project to work with, but this project needs to upload to your client's git repository. But at the same time, you want to upload the project with commits in your git profile too. And you can push a project in multiple repositories by following this post.

Video Tutorial:



Step 01: Create two repositories

Create two repositories in two different accounts and add a collaborator for a git repository that you want to use as a second repository to push the project.


Step 02: Push your project

Now push your project into one of your repositories by using the following commands

git init
git add .
git commit -m "First commit"
git branch -M main
git remote add origin <YOUR REPOSITORY HTTPS URL>
git push -u origin main

Now, you can see the updates in your repository.


Step 03: Add your 2nd repository

Now add your second repository as a push origin by following the command,

git remote set-url --add --push origin <YOUR 2ND REPOSITORY HTTPS URL>

Now you can see your second repository as a push URL by using the following command

git remote -v


So, again add the first repository URL with the following command

git remote set-url --add --push origin <YOUR 1ST REPOSITORY HTTPS URL>

Now you can see your both repository as a push URL by the following command again

git remote -v



Step 04: Push the project again

Now push your project with the following commands

git add .
git commit -m "Changes"
git push

It will push your project into both repositories.

Hope it will help you.

Thanks for reading


Like 0
Related Posts
Upload existing project to github
Upload existing project to github
01 October 2022 · 1.5K Views
What is GitHub and how it works
What is GitHub and how it works
14 January 2026 · 32 Views
GitHub tutorial for beginners step by step
GitHub tutorial for beginners step by step
18 January 2026 · 23 Views
How to create your first GitHub repository
How to create your first GitHub repository
19 January 2026 · 19 Views

Comments (0)

No comments yet. Be the first to leave your thoughts!

Leave a Comment

You need to login to post a comment

Login to Comment