This file contains 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
#!/bin/bash | |
# git-cleanup-repo | |
# | |
# Adapted by Jannis Mainczyk <[email protected]> | |
# - support different default branches | |
# - add output per step | |
# Adapted by Rob Miller <[email protected]> | |
# Original by Yorick Sijsling | |
default_branch=${1:-master} | |
read -p "Continue with default branch '${default_branch}' (y/N)? " |
This file contains 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
# | |
# Working with branches | |
# | |
# Get the current branch name (not so useful in itself, but used in | |
# other aliases) | |
branch-name = "!git rev-parse --abbrev-ref HEAD" | |
# Push the current branch to the remote "origin", and set it to track | |
# the upstream branch | |
publish = "!git push -u origin $(git branch-name)" |
This file contains 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
#!/usr/bin/env python3 | |
def load_gist(gist_id): | |
"""translate Gist ID to URL""" | |
from json import load | |
from urllib.request import urlopen | |
gist_api = urlopen("https://api.github.com/gists/" + gist_id) |