Skip to content

Instantly share code, notes, and snippets.

View zimmski's full-sized avatar

Markus Zimmermann zimmski

View GitHub Profile
@slifty
slifty / git-commit-edit-alias.md
Last active December 12, 2023 17:42
Git alias to edit a commit

A git alias to edit the content of a commit

This git alias allows you to remove specific changes from a past commit / from git history and place those changes into your working directory, outside of your git history.

For example, maybe a code reviewer has identified a few files or lines that belong in their own commit or pull request. This helps you do git commit surgery on specific commits without needing to manually re-play.

git edit {commithash}

(e.g. git edit HEAD would edit the most recent commit or git edit c52b7bfe12c2f6082a69ea339eeec95a20532fa5 would edit a specific commit)

@h12w
h12w / goclean.sh
Last active August 24, 2021 03:13
golcean.sh does automatic checking on a Go package and its sub-packages.
#!/bin/bash
# The script does automatic checking on a Go package and its sub-packages, including:
# 1. gofmt (http://golang.org/cmd/gofmt/)
# 2. goimports (https://github.com/bradfitz/goimports)
# 3. golint (https://github.com/golang/lint)
# 4. go vet (http://golang.org/cmd/vet)
# 5. race detector (http://blog.golang.org/race-detector)
# 6. test coverage (http://blog.golang.org/cover)
set -e