To insert a branch into a remote repository, you must use this syntax
git push (remote) (branch)
Usually the first remote (and often unique) is called the "source", so in your case you will run
git push origin foo
It is generally recommended that you run a slightly more complex command.
git branch --set-upstream-to origin/foo
because "--set-upstream-to" (abbreviated "-u") has set tracking on this thread and will allow you to simply push other changes
git push origin
"Tracking branches are local branches that have a direct link to the remote branch. If you are in the tracking branch and type git pull, git will automatically know which server will be pulled from and the branch to join." (cit. git)
David
source share