📜 ⬆️ ⬇️

Git 2.3 has been released

Greetings, colleagues! This morning, the githab published a detailed article on a freshly released version of git. You can pick it up, as usual, on the official website , and under the cut a brief translation of what's new and interesting: push-to-deploy, manual control of SSH parameters, a way to prevent cit scripts from hanging with a git client, and much more.



Push to deploy


')
The ability to configure the remote repository in such a way that the received push automatically makes checkout (provided that there are no local changes on this computer, of course). This function is convenient for test and internal deploy: there is no need to install additional scripts, push to the server automatically changes its files in the working copy, and not only adds them to the repository.

The authors warn that using this functionality for deploy production servers is not recommended, as there are a number of side effects:


Fast cloning with already cloned local repository



The new --dissociate key allows you to pick up the necessary files from the specified local repository using the --reference during cloning: this allows you to greatly reduce the cloning time and network load if you already have a copy of the required repository somewhere on the disk:

git clone --reference ../oldclone --dissociate https://github.com/gitster/git.git 


More conservative default git push behavior



Remember, lately, when pushing branches, git constantly recommended setting “push.default”, hinting that the default behavior will soon change? It has changed. Now, if the name of the local branch is different from the name of the upstream branch, then git will refuse to push without specifying remote to protect you from pushing the wrong branch:

 git checkout -b experimental origin/master git commit -a -m 'Experimental changes' git push #      -     push  'experimental',    'master'. 


SSH connection options can now be set manually



Using the GIT_SSH_COMMAND environment variable, you can now precisely configure how git will use ssh. Finally, you can easily make different private keys for different repositories without modifying the user-wide "~ / .ssh / config":

 GIT_SSH_COMMAND='ssh -i git_id' git clone host:repo.git 


Ability to disable user input during automation



By setting the environment variable GIT_TERMINAL_PROMPT to 0, you can disable user input. This is useful when git is called from an automation script and user input is not implied - now when authorization errors occur, git will not prompt for a login / password and thereby suspend the cron script.

Trivia




Everything



If I missed something, misunderstood or incorrectly translated - write.

Source: https://habr.com/ru/post/249857/


All Articles