Git 2.0 Release
Git 2.0 was just released!
Git, for those of you that don’t know, is a free and open source version control system. It’s something we use here at WDG for every project and on a daily (if not hourly) basis.
Significant changes were made including bug fixes, updates, and most importantly backward compatibility changes. That being said, this is not a major overhaul, but more of an incremental step towards a better git.
Here at WDG we use git on all our projects to ensure versions of our code is stored remotely while we’re working and so any number of developers can work on a single project at the same time. You can check out our past article on Must Have Tools for Web Developers to learn more.
A few key takeaway’s from the official release notes
Git Push Defaults to Simple
Git push now defaults to “simple” instead of “matching” when no file is specified. This new default means that when you are working in an environment with multiple branches, only the current branch you are working on will be pushed. Before, all branches with a remote would be pushed up stream, so you could accidentally push code that wasn’t production ready.
Git Add Runs on the Entire Tree and Records Removals
Git add -u and Git add -A are now run on the entire tree when ran inside a subdirectory. Before these actions would match the file pattern against already tracked files in the index rather than the working tree. Git add is now the same as Git add -A and also records removals, whereas in earlier versions you had to perform git rm on the files to remove before they were staged.
Git Rebase Change for Branches
Git rebase now interprets “-” as the branch you were previously on. That means if you use “git rebase -” you can automatically rebase to the last branch you were on.
Other Minor Changes
- GIT grep now behaves like native grep when given no header and count options.
- Trailing whitespace is now ignored in the gitignore file.
- Git pull can be told to only accept fast-forward in a setting in the configuration file.
Some of the git commands got a little more specific and it seems as though an effort has been made to try and cut down on user error. Overall, the new changes should provide for a more intuitive experience for current and new git users alike. For some, such as myself, these commands may not make their way into your day-to-day workflow, but are going to be extremely useful to you git power-users. You can read more about changes, performance optimizations, and bug fixes in the official release notes. If you’re new to git, we highly recommend the new Git Tutorial on Github by CodeSchool.