git add new remote branch code example

Example 1: git set remote

git remote set-url origin https://github.com/USERNAME/REPOSITORY.git

Example 2: git new branch push to remote

git push -u origin <branch>

Example 3: git add remote

git remote add heroku https://git.heroku.com/arrecs.git
git remote -v
-> heroku	https://git.heroku.com/arrecs.git (fetch)
-> heroku	https://git.heroku.com/arrecs.git (push)

git remote remove heroku
git remote -v

Example 4: create new remote branch

git checkout -b <new-branch-name>	#Create new branch locally
git push <remote-name> <new-branch-name> #Create new branch remotely

Tags:

Misc Example