**Step-by-Step Guide
Initialize the Local Repository: If you haven't already initialized a repository locally:
git init
Add the First Remote Repository (example: nurul):
git remote add yourName repository-url
Add the Second Remote Repository (example: expertsquad):
git remote add companyName repository-url
Verify the Remotes: Check if both remotes are added correctly:
git remote -v
You should see output like:
yourName https://github.com/your-username/repo-name.git (fetch)
yourName https://github.com/your-username/repo-name.git (push)
companyName https://github.com/company-username/repo-name.git (fetch)
companyName https://github.com/company-username/repo-name.git (push)
Push to Both Repositories Simultaneously: If you want to push changes to both repositories:
git push yourName main
git push companyName main
Automate Pushing to Both Remotes (Optional): Create a custom alias in Git to push to both remotes at once:
git config --global alias.pushall '!git push yourName && git push companyName'
Now, you can use:
git pushall
Notes:
Replace main with the branch name you're working on if it's different.
Ensure that both remotes are up-to-date with proper access rights (SSH keys or tokens if needed).
Use branches carefully if the repositories have different requirements.
Let me know if you need further clarification!
Top comments (1)
Oh, That's millon doller concept.