Skip to content

Instantly share code, notes, and snippets.

@schocco
Last active April 3, 2018 08:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schocco/b647402dc80d072ede32317656ac2c70 to your computer and use it in GitHub Desktop.
Save schocco/b647402dc80d072ede32317656ac2c70 to your computer and use it in GitHub Desktop.
git features that you should start using

git features that you should start using

A collection of basic and advanced features which come in handy for developers but are not known or used by many among us.

First of all: don't be afraid of command line interfaces!

Managing the git history

rewriting with interactive rebase and amend searching in the history https://git-scm.com/book/en/v2/Git-Tools-Searching

Submodules

use submodules to include dependencies which have their own lifecycle (e.g. own npm or jar libraries)

Managing local repo state

Bisect

Binary search to find the commit which caused a regression bug between two releases

git aliases

  • delete all branches which have already been merged to the current branch (exclude master and development):   git config --global alias.rmbranches '!git branch --merged | egrep -v "(^\*|master|development)" | xargs git branch -d'  
  • pick whatever you find useful from one of many collections

Bonus: Shell extensions

Customize your bash/zsh shell to display the current branch or other useful context information, autocompletion for git aliases

@rixlabs
Copy link

rixlabs commented Apr 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment