Chris Muench
Chris Muench

Reputation: 18318

Updating git version...Do I need to do anything to repository that used older git version

If I update git from 1.7.1 to 2.4.1 do I need to do anything to my local repositories after updating the version of git?

Upvotes: 2

Views: 85

Answers (1)

Arkadiusz Drabczyk
Arkadiusz Drabczyk

Reputation: 12393

Not really, I think. The only difference in everyday usage of git between version 1.7.x and 2.0 I noted is the following message which is printed when doing git push:

warning: push.default is unset; its implicit value has changed in Git
2.0 from 'matching' to 'simple'. To squelch this message and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple' behavior, which only pushes the current branch to the corresponding remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information. (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode 'current' instead of 'simple' if you sometimes use older versions of Git)

Counting objects: 15, done.
(...)

Anyway, it's always a good idea to read release notes before upgrading, especially if you administer a repository. For example, the above behavior has been documented in release notes:

When "git push [$there]" does not say what to push, we have used the
traditional "matching" semantics so far (all your branches were sent
to the remote as long as there already are branches of the same name
over there).  In Git 2.0, the default is now the "simple" semantics,
which pushes:

 - only the current branch to the branch with the same name, and only
   when the current branch is set to integrate with that remote
   branch, if you are pushing to the same remote as you fetch from; or

 - only the current branch to the branch with the same name, if you
   are pushing to a remote that is not where you usually fetch from.

You can use the configuration variable "push.default" to change
this.  If you are an old-timer who wants to keep using the
"matching" semantics, you can set the variable to "matching", for
example.  Read the documentation for other possibilities.

Upvotes: 1

Related Questions