$ sudo apt-get install git-clang-format
$ clang-format --version
clang-format version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
$
$ clang-format -i *.cpp *.h
$
Check if already installed
$ which git-clang-format
$
$ which git-clang-format-3.8
/usr/bin/git-clang-format-3.8
$ ls -l /usr/bin/git-clang-format-3.8
lrwxrwxrwx 1 root root 36 Jul 12 2016 /usr/bin/git-clang-format-3.8 -> ../lib/llvm-3.8/bin/git-clang-format
$
If not installed install git-clang-format
$wget https://raw.githubusercontent.com/llvm-mirror/clang/master/tools/clang-format/git-clang-format
$ git add .
$ git-clang-format-3.8
changed files:
anyoption.cpp
$ git add anyoption.cpp