Git Push Default

Tuesday, 28 January 2014, 21:58

Tags: Git VCS

When I was doing my first push in Git I got the following warning.

  • The reason for the warning is, as mentioned, that the default push strategy is not configured and that its default is going to change in Git 2.0. It is safer to explicitly set the default push strategy to the strategy you want instead of depending on the default.
  • There are several strategies from which you can choose.
  • nothing: Do not push anything.
  • matching: Push all the branches which have the same name locally and remotely.
  • upstream: Push the current branch to its upstream branch even if the names differ.
  • current: Push the current branch to an upstream branch with the same name.
  • simple: Push the current branch to its upstream branch when they have the same name.

I have chosen the simple strategy because it is the safest. Only the branch you are working on will be pushed to its upstream branch under the condition that the name is the same locally and remotely.