Does git push work like the abbreviation git push origin newfeature?

I note that the default behavior of git push origin is to "push all branches with the same local and remote name".

If I create a new branch newfeature and newfeature it, will git push redirect the branch to origin by default?

Or do I need to use git push origin newfeature even when it selects?

Next, how does this git push HEAD command relate to this?

+6
source share
1 answer

By default, it will press newfeature if and only if a branch named newfeature already exists on the remote control.

You can change this using the push.default configuration push.default .

git push HEAD is essentially a shorthand for git push <name of checked out branch> if you checked the branch.

+7
source

Source: https://habr.com/ru/post/891300/


All Articles