Nouveautés de Git 1.9

Nicola Paolucci
Nicola Paolucci
Retour à la liste

Je sais que vous êtes tous très occupés par vos marathons de pillage sur DayZ, mais soyez un peu patients. Il faut que vous sachiez quelque chose. La dernière livraison de Git (1.9) est sortie !

Here is what caught my eye from the release notes. If you're inclined you can obviously go ahead and scour the notes in all their nerdy beauty by yourself. But let me help!

Before I start let me also gently point you to my earlier notes on releases 1.8.2, 1.8.3, 1.8.4, 1.8.5. Lots of neat tricks and goodies in there, too.

Pointeurs de mise à niveau pour tout le monde

Comment mettre à niveau ? Les instructions ci-dessous devraient vous y préparer :

  • Type brew update && brew upgrade git if you use homebrew on OSX.
  • Use a magic apt trick if on Ubuntu based distributions (I leave other distributions as an exercise for the reader).
  • Simply run the new installer if on Windows (the Windows port sometimes lags a bit behind so please be patient if you can't find it right away).

Note!: Package managers in some cases might delay the distribution of the update; that is out of my hands.

Mises à jour des opérations de réseau : push et fetch

"git fetch --tags" now fetches all plus tags

The meaning of the --tags option in git fetch has changed; The command now fetches tags in addition to what is fetched by the same command without the option.

Now you can "fetch" from a shallow-clone!

You can now fetch from a shallowly-cloned repository, an action that was forbidden before; Note that the receiver becomes now a shallow repository with a truncated history too.

La sémantique de la commande « git push origin master » standard est plus fiable.

git push origin master or more generally any git push $where $what has been enhanced to use the same ref mapping git push origin would use to determine which ref at the origin is to be updated to the local master. For example, with this configuration:

[remote "origin"]
push = refs/heads/*:refs/review/*

Just like git push origin would push out our local branches to corresponding refs under refs/review/ hierarchy at origin, git push origin master will now update refs/review/master over there.

Consignation et apparence

Consigner tout sauf le répertoire

The negative pathspec syntax allows git log ‐‐ . ':!dir' to tell us I am interested in everything but the 'dir' directory.

progression difftool

git difftool shows how many different paths there are in total, and how many of them have been shown so far, to indicate progress.

Couleurs et formats avec « for-earch-ref »

git for-each-ref ‐‐format=... learned a few formatting directives:

p. ex. « %(color:red)%(HEAD)%(color:reset) %(refname:short) %(subject) »

git log learned "‐‐exclude={glob}", pretty cool!

git log and friends learned the ‐‐exclude={glob} option, to allow people to say list history of all branches except those that match this pattern with git log ‐‐exclude='_/_' ‐‐branches.

Autres améliorations

git merge-base ‐‐fork-point to find a fork point out of the reflog

git merge-base learned the ‐‐fork-point mode, that implements the same logic used in git pull ‐‐rebase to find a suitable fork point out of the reflog entries for the remote-tracking branch the work has been based on. git rebase has the same logic that can be triggered with the ‐‐fork-point option.

Some deprecated commands are gone!

Une poignée d'anciennes commandes depuis longtemps obsolètes ont finalement été retirées, à savoir :

repo-config, tar-tree, lost-found et peek-remote

Submodule : « git submodule foreach » est plus robuste

The command string given to git submodule foreach $cmd $args is passed directly to the shell, without being eval'ed. This is a backward incompatible change that may break existing users. This differs now from how ssh does the parsing. In short it's not needed to over quote the $args anymore.


That's it for now. Let me know if you find this update useful and stay tuned for more. Follow me @durdn and the awesome @AtlDevtools team for more DVCS rocking.

Prêt à découvrir Git ?

Essayez ce tutoriel interactif.

Démarrez maintenant