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
#!/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 //') |
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
#!/bin/bash | |
set -euo pipefail | |
function git_branch { | |
git branch 2>&1 | grep '^\*' | sed 's/\* //g' | |
} | |
function git_repo { | |
grep 'url = [email protected]:' .git/config \ |