Skip to content

Instantly share code, notes, and snippets.


Jenn Cooper jenncoop

View GitHub Profile
expede / debase.zsh
Last active Aug 29, 2015
git debase
View debase.zsh
# Similar to a squashed rebase
# Merges branch A into B, and then resets the branch to A,
# producing an unstaged diff of B for your commit
# exampe usage: `debase master`
# (note the lack of `git` prefix)
function debase() {
if [[ -z $1 ]]; then
echo 'missing branch to debase from'

git-remaster updates both your current branch and master branch simultaneously, while preserving all commited, staged and unstaged changes.


Add git-remaster to your path and make it executable:

curl > /usr/local/bin/git-remaster
chmod +x /usr/local/bin/git-remaster
pixelhandler /
Last active Jun 23, 2022
Git pre-push hook to prevent force pushing master branch
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
# If this script exits with a non-zero status nothing will be pushed.
# Steps to install, from the root directory of your repo...
# 1. Copy the file into your repo at `.git/hooks/pre-push`
# 2. Set executable permissions, run `chmod +x .git/hooks/pre-push`