push code to github remote branch code example

Example 1: git new branch push to remote

git push -u origin <branch>

Example 2: git push new repo to remote

$ git remote add origin <remote repository URL>
# Sets the new remote

# Push the changes in your local repository to GitHub.
$ git push -u origin master
# Pushes the changes in your local repository up to the remote repository you specified as the origin

Example 3: push local branch changes to remote branch

git push -u origin localBranch:remoteBranchToBeCreated