#!/bin/bash add-git-remote() { if [[ -z "$1" ]]; then echo '$1/remote is empty.' exit fi if [[ -z "$2" ]]; then echo '$2/url is empty.' exit fi if [[ -z "$3" ]]; then echo '$3/path is empty.' exit fi echo "Add remote $1 with url $2 to $3:" git -C "$3" remote add "$1" "$2" }