e4rthdog
e4rthdog

Reputation: 5223

What i need to take care to upgrade from git 1.9.5 to latest 2.6?

I have been using version 1.x for all my projects.

Is it safe to just upgrade to the latest 2.6?

On workstations i use sourcetreee and git extensions.

All our repositories are stored in a central server which serve as our origin remote.

Upvotes: 9

Views: 1711

Answers (2)

comiventor
comiventor

Reputation: 4122

A more practical and handy list can be found here https://felipec.wordpress.com/2014/05/29/git-v2-0-0/

Most of it is related to default behavior. If one uses clear specific commands, then s/he will not face any issue.

git push When you type ‘git push’ (without any arguments), Git uses the configuration ‘push.default’ in order to find out what to push. Before ‘push.default’ defaulted to ‘matching’, and now it defaults to ‘simple’.

The ‘matching’ configuration essentially converts ‘git push‘ into ‘git push origin :‘, which means push all the matching branches, so if you have a local ‘master’, and there’s a remote ‘master’, ‘master’ is pushed; if you have a local and remote ‘fix-1’, ‘fix-1’ is pushed, if you have a local ‘ext-feature-1’, but there’s no matching remote branch, it’s not pushed, and so on.

The ‘simple’ configuration pushes a single branch instead, and it uses your configured upstream branch (see this post for a full explanation of the upstream branch), so if your current branch is ‘master’, and if ‘origin/master’ is the upstream of your ‘master’ branch, ‘git push’ will basically be the same as ‘git push origin master‘, or to be more specific ‘git push origin master:master‘ (the upstream branch can have a different name).

‘git add’ in directory adds removals

Upvotes: -1

VonC
VonC

Reputation: 1324977

Yes, git 2.6 will open your repos initially created with 1.9.x without any issue.
The best practice is to make sure the git version on the server is greater or equal to the one used by the clients, but in practice, I have been using 2.x clients pushing to an 1.9.x server for months without any problem.

Check a few settings that have changed with git 2.0 though:

In Git 2.0 the push.default has been changed to simple which is narrower in scope – more specific and more intuitive – it will now only push:

  • The current branch to the branch with the same name only when the current branch is set to integrate with that remote branch on the same remote;
  • 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.

And:

git add path now equates git add -A path

Upvotes: 6

Related Questions