I have an existing git repository hosted on my company's online git account. I now want to set up a second remote within my client's online git account. I want to keep my company's repository as the primary day-to-day means of sharing code and the client's one just with the master branch for the current releases.
I have used
git remote add <clientName> <clientRepoUrl>
git push <clientName> --all # pushes up the repo and its refs for the first time
But what if I omit the --all parameter?
You can simply push only
git push origin master) to the second remote repo.
That will include all commits accessible from
master, including the merge commits parents.
x--x--x--x--M --x (master) \ / y----y (branchY)
master only would push
y commits, even though the reference
branchY itself would not be pushed.