Multiple Remote repositories

I have added same remote repository from different user(system) with different name (origin and feature) can we push from different system to the master branch.

would it be possible to merge 1 branch to the other without touching the master branch.

Yes, you can push from multiple machines to the same remote repository, even if you give that remote repository a different name on the other two machines. The name is just to make it easy for you to work with remote repositories, git uses URLs under the hood. As long as the URL is the same, you’ll be pushing to the same server. You can check the URL for your remote repos with git remote -v.

Can you explain this in a bit more detail? I’m not sure I understand what you mean.

i have a remote repo in github and i am using git CLI to add that remote repo to my system using git add remote origin
after adding that remote repo to my local GIT, i have created 2 new branches in the local GIT and now i want to push these changes to my remote GITHUB repo and see those 2 newly created branched in the github GUI.

just go to new separate branches with git checkout, and execute git push origin <branchname>. Or you could also run git push -u origin <branchname>. That ties your local branch to the remote branch, so that in the future git push (without specifying the remote and remote branch name) is enough to update your changes on the remote server.

I hope that answers your question? :slight_smile:

thanks for the reply but how about if i delete one branch from the CLI using git branch -d , how will i push those changes to the remote repo (origin).

You mean that you want to remove the branch on the remote repository too? There’s 2 options for that:

  • use GitHub’s UI to do so
  • run git push --delete origin <branchname> to do it from the CLI

great. thanks for the reply. you can close the ticket now.