What does git do when I click on a local branch that does not exist on the remote server?

I have git vanilla with the default setting, version 1.7.1.

So, I do the following:

git branch local_only
git checkout local_only
git push

local_only does not exist on the remote control.

The team pushtakes a few seconds to complete it, and ultimately tells me "Everything is relevant." I would like to understand what is actually doing pushin this situation:

  • If git checks to see if a remote branch exists, why doesn't it return an error? OR

  • If git did not check if the remote branch exists or not, why does it take a few seconds and return a success response?

git branch -avv output:

* local_only            ...commit...
master                  ...commit...
remotes/origin/master   ...commit...
+4
source share
2 answers

You need to click it like this:

git branch local_only
git checkout local_only
git push origin 

. . "Pushing" : http://git-scm.com/book/en/Git-Branching-Remote-Branches


, git, git '. article 'git push' 'git push origin master: master'. origin/master , - master, , .

+1

, push.default(git config push.default).

- matching, , git , .

, git push, , .

git simple, , .

. git config:

push.default
git push , refcpec . ; , (.. ), , , .

(git push <remote> <branch>), (git push -u <remote> <branch>).

+1

All Articles