Skip to content

Instantly share code, notes, and snippets.

View cssence's full-sized avatar

Matthias Zöchling cssence

View GitHub Profile
#!/usr/bin/env bash
git filter-branch --env-filter '
CORRECT_NAME="$1"
OLD_EMAIL="$2"
CORRECT_EMAIL="$3"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
@cssence
cssence / rrm-macdroppings.sh
Last active January 20, 2018 16:14
Recursively Remove .DS_Store
find . -name '.DS_Store' -type f -delete
@cssence
cssence / .bash_profile snippet ~ .sh
Created June 3, 2016 06:29
Avoid history duplicates
export HISTCONTROL=ignoredups:erasedups
shopt -s histappend
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
#!/bin/bash
read -p "Ensure param #1 (\"$1\") format is \"YYYY-MM-DDThh:mm:ss\", then press [ENTER] to commit..."
GIT_AUTHOR_DATE="$1" GIT_COMMITTER_DATE="$1" git commit $2
@cssence
cssence / git-rebase-feat.sh
Created March 4, 2026 09:30
Rebase feature branch after latest commit on target branch has been modified
# interactively rebase last <n> commits (defaults to 2):
# pick needed ones and drop those that got modified on target branch
git rebase -i HEAD~${1-"2"}
# now reintegrate target branch (defaults to main)
git rebase ${2-"main"}
echo "Learn more at https://cssence.com/2026/rebase-feature-branch/"