Skip to content

Instantly share code, notes, and snippets.

View deepbrook's full-sized avatar

Nils Diefenbach deepbrook

  • BioNTech SE
  • Koblenz
View GitHub Profile
@chrismccoy
chrismccoy / gitcheats.txt
Last active August 8, 2024 12:56
git cheats
# alias to edit commit messages without using rebase interactive
# example: git reword commithash message
reword = "!f() {\n GIT_SEQUENCE_EDITOR=\"sed -i 1s/^pick/reword/\" GIT_EDITOR=\"printf \\\"%s\\n\\\" \\\"$2\\\" >\" git rebase -i \"$1^\";\n git push -f;\n}; f"
# count total commits in a repo
git rev-list --all --count
# edit all commit messages
git rebase -i --root
@prwhite
prwhite / Makefile
Last active September 19, 2024 17:21
Add a help target to a Makefile that will allow all targets to be self documenting
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Everything below is an example
target00: ## This message will show up when typing 'make help'
@echo does nothing
@snim2
snim2 / pre-commit.py
Created September 5, 2013 00:50
A git pre-commit hook to test Python code for PEP8 compliance, and run unit tests via the pytest framework
#!/usr/bin/env python
"""
Git pre-commit hook to enforce PEP8 rules and run unit tests.
Copyright (C) Sarah Mount, 2013.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2