git push to remote branch command code example

Example 1: add remote branch git

git remote add github git://github.com/jdoe/coolapp.git
git fetch github

Example 2: git push branch

git push -u origin <branch>

Example 3: git push in a new branch

git checkout -b <branch>
git add .
git commit -m "comment"
git push -u origin <branch>

Example 4: push local branch changes to remote branch

git push -u origin localBranch:remoteBranchToBeCreated

Example 5: Push your branch up to the remote.

$ git push <remote> <branch>