git says everything-up-to-date when pushing changes to a remote branch
Depending on your version of Git, it may be trying to push branches with matching names, i.e., master
to origin/master
and remote_branch
to origin/remote_branch
. If your origin repository doesn't have a branch named mybranch
then it thinks there's nothing to update.
To override this default, you can explicitly tell git which branch to use as the source (mybranch
) and which to use as the destination on the remote repository (remote_branch
):
git push origin mybranch:remote_branch
There's a config option to tell git to push to remote tracking branches by default:
git config --global push.default tracking
I find this more intuitive and I think it's the behavior you're looking for. Checkout the push.default
option in the git config man page. Also checkout the Examples section in the git push man page to see how to override the default behavior.