Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View clockworksoul's full-sized avatar
👋
Hi, I'm Matt.

Matt Titmus clockworksoul

👋
Hi, I'm Matt.
View GitHub Profile
@clockworksoul
clockworksoul / sync.sh
Last active November 24, 2021 17:06
Syncs a fork with its parent repo (so you don't have to)
#!/usr/bin/env bash
# For best results, drop this into your path as "git-sync" and "chmod +x" it.
#
# From that point forward, you'll be able to use "git sync" as a command to
# synchronize any repository with a registered upstream.
set -eo pipefail
CURRENT_BRANCH=$(git status | grep '^On branch ' | sed 's/On branch //')
@clockworksoul
clockworksoul / redefault.sh
Created September 27, 2020 12:14
Simple bash script to create and switch master to main branch
#!/bin/bash
set -euo pipefail
function git_branch {
git branch 2>&1 | grep '^\*' | sed 's/\* //g'
}
function git_repo {
grep 'url = git@github.com:' .git/config \