Skip to content

clang-format

Format Code

  • Format the previous commit using clang-format:

    git clang-format HEAD~1
    

  • Format only one file in the previous commit:

    git clang-format HEAD~1 <file>
    

  • Add the changes to the commit:

    git commit --amend --no-edit
    

Tags