Created
March 14, 2013 16:22
-
-
Save danielhopkins/5162770 to your computer and use it in GitHub Desktop.
git push mirror
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from .git_functions | |
function git_helpers_clean_remote() { | |
remote=$1 | |
git ls-remote -h $remote | | |
git show-ref --heads --exclude-existing | | |
cut -f 2 | xargs git push --delete $remote | |
} | |
# from .gitconfig | |
[alias] | |
pm = !git push -f --all $1 && git clean-remote $1 | |
# So the idea here is that on *my forks* I keep them looking exactly like | |
# my working directory. Github is almost a form of backup / publically viewable code repo at this point. | |
# The nice thing is that when I delete a branch, it gets cleaned up from the remote and | |
# I also push to the remote extremely frequently (really could be a post_commit hook) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment