You can find documentation on push.default
here
simple
is intended to be the 'probably does what you want' default in newer git versions. It's a halfway-house between current
and upstream
.
Let's assume that you're working on a branch called foo
.
current
means that if you either tell git to push to the place you normally pull from (git push
or git push origin
), or if you tell it to push to some other remote repository (git push somewhere_else
), it will push a branch called foo
to a remote branch also called foo
. This means that git push
will be interpreted as git push origin foo:foo
.
upstream
means that if you tell git to push to the place you normally pull from, it will push the branch to whatever remote branch it is tracking - i.e. the branch that you get updates from when you pull. You can find this in the config
file inside the repository's .git
folder. For example, if it contains the section
[branch "foo"]
remote = origin
merge = refs/heads/bar
then that means that a straightforward git push
when you've got branch foo
checked out will push to origin/bar
, so it's equivalent to git push origin foo:bar
.
upstream
only makes sense when you're pushing to the place you pull from. If your local branch isn't tracking an upstream branch, nothing will happen (though git will suggest a single line push-and-start-tracking command, see below).
simple
does the same as upstream
when you push to the place you normally pull from, and does the same as current
if you're pushing somewhere else.
Now, you mentioned in your post that you're dealing with a local branch, which presumably means it's not tracking anything on the remote end. You can push a branch and make it track the place it was pushed to with the following:
git push --set-upstream origin foo:bar
Leaving out the :bar
will make it push to a branch with the same name as the local branch.