New Git 2.8.0 has been released ! During the last couple of weeks, when the release was in the candidate's stage, I walked through the list of commits and notes to it, trying new things and noting interesting points. To save your time, I propose a subjective selection of features worth trying. Use!
push -d
, a synonym for push --delete
This is a great addition to both the completeness of the set of options and the speed of the instruction set. You may already be using git branch -d
to remove the local branch, and now you can also shorten the remote-branch removal command to git push -d
.
git branch -d my-branch # , git push -d origin my-branch # remote- origin-
git grep
A couple of current features have been integrated into the git grep
functionality:
grep
use to search the object tree. Add --num-threads
to the command or specify the grep.threads
parameter in .gitconfig
to make the setting permanent. git grep --num-threads=5 <pattern>
git grep
in a folder that does not belong to the git repository, Git will start searching for the root of the repository, recursively checking the parent folder - this does not always correspond to what we would like to receive as a result. With the new version, it became possible to use git grep
outside the git repository, explicitly specifying the option --no-index
. To make this behavior standard, just add the grep.fallbackToNoIndex
parameter to the Git configuration. git grep --no-index <pattern>
pull --rebase
The git pull --rebase
can now be run interactively:
git pull --rebase=interactive
This is an interesting addition to the process of pull rebase, when you want to close commits or change their comments right at the time of the pull (do not forget about the standard warnings about the use of rebase ).
git config
;)Now git config
can show where the value was set: whether it is defined in the configuration file or a blob file, read from standard input, or specified on the command line. For example, I can ask: "Where did I define my alias st
(status)?" , - and git config
will tell me the answer:
git config --show-origin alias.st file:/Users/np/.gitconfig status -s
git blame
takes a lot of time.<branch>^{/!-<pattern>}
become available. It allows you to refer to the commit, reachable from the branch <branch>
, but not satisfying the given pattern <pattern>
.git fetch
command to use only the IPv4 (or IPv6) protocol when it is executed. Add a parameter: git fetch -4
or git fetch -6
, respectively.git worktree add -B <branchname>
did not work properly, this bug has been fixed.The above is just a sample, the release contains much more! More information about other innovations included in Git 2.8.0 can be found in the source code and the full release notes .
Nicola Paolucci - Developer Advocate in Atlassian. He writes and talks about git, development processes, code collaboration, Docker. Before Atlassian, he led development teams, built crowd sourcing applications for geospatial data, and worked on deploying large e-commerce systems. Some facts about Nicola: he is actively gesticulating when he speaks (as an Italian), lives in Amsterdam and goes to Ducati. Nicola can be found on Twitter under the pseudonym @durdn .
Source: https://habr.com/ru/post/281188/
All Articles