You should prefer to use SSH. According to GitHub, "We strongly recommend using an SSH connection when interacting with GitHub. SSH keys are a way to identify trusted computers, without involving passwords."
Anyone using RHEL/CentOS 6 will be using git 1.7.1 by default, which supports set-url.
When on branch , it overrides branch..remote for pushing. It also overrides remote.pushDefault for pushing from branch . When you pull from one place (e.g. your upstream) and push to another place (e.g. your own publishing repository), you would want to set remote.pushDefault to specify the remote to push to for all branches, and use this option to override it for a specific branch.
I use such a triangular workflow 一直都是 for open-source contributions. For example: I have my own GitHub fork of llvm/llvm-project, and I want to keep my own main branch up-to-date with the upstream's main. So I frequently git pull upstream main; it would be convenient if I could just type git pull instead. 但是, I don't want any chance that I might fat-finger git push<return> instead of git push origin main<return> and accidentally main0 to the upstream project's repo before I intended to! So, before today, my .git/config looked like this:
Now I can do a simple git checkout main ; git pull to pull from upstream/main, and a simple git checkout main ; git push to push to origin/main. This is the "triangular workflow" I want.