Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Git 2.10 Improves Push and Worktree Commands, Adds Style Options, and More

Git 2.10 Improves Push and Worktree Commands, Adds Style Options, and More

This item in japanese

Lire ce contenu en français


Recently released Git 2.10 adds a few useful features to push, including more accurate progress info, support for extra options, and an improved --force-with-lease. Additionally, a few new options make working with signatures more convenient, and coloring schemes can use italic and strikethrough styles.

Among the improvements to git push are:

  • git push --force-with-lease, which will ensure you do not overwrite a simultaneous push by some other contributors, now make sure a new ref is created. This makes it unnecessary to use update-ref before doing a push after a fetch not followed by merge.

  • to reduce the risk of confusion, a remote: prefix is now added on the client side to messages generated on the server by git gc during a push. git gc runs a number of housekeeping tasks, such as compressing file revisions, and is run automatically by certain commands.

  • the new --push-option flag allows developers to pass extra options to the receiving end for the pre-receive and the post-receive hooks.

  • git push now produces more accurate reports for tasks that are run on the server after the push payload has been received. GitHub has published a nice description of the feature.

The worktree command has also got a couple of improvements, including:

  • git worktree add can now use - as a short-hand for the previous branch, fully represented a @{-1}.

  • git worktree lock allows developers to prevent a linked working tree stored on a portable device or network share that is not always mounted from being pruned. Previously, developers were expected to lock a worktree by manually creating a file named locked along with other administrative files in the worktree.

As mentioned, working with signatures has become easier in Git 2.10. Indeed, git log and other commands will now display the full 64 bit key-id. Moreover, git log can be made to show signatures by default using the new log.showSignature configuration variable, that can be overridden using the --no-show-signature flag. Additionally, git pull --rebase will now warn users that passing the --verify-signature is a no-op.

Finally, output color schemes have been enriched by adding support for italic and strike-through text, which can be combined with other coloring options.

Git 2.10 includes many more new features, improvements, and bug fixes that are listed in the release notes.

Rate this Article


Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p