28
loading...
This website collects cookies to deliver better user experience
git remote add theirusername [email protected]:theirusername/reponame.git
git fetch theirusername
git checkout -b mynamefortheirbranch theirusername/theirbranch
git-fork-pull
im sure there are 1000 other things I could've called it, but naming is hard.git-fork-pull reponame theirname theirbranch mybranch
git-fork-pull() {
reponame="$1"
theirname="$2"
theirbranch="$3"
mybranch="$4"
}
git-fork-pull() {
reponame="$1"
theirname="$2"
theirbranch="$3"
mybranch="$4"
git remote add "$theirname" "[email protected]:$theirname/$reponame.git"
git fetch "$theirname"
git checkout -b "$mybranch" "$theirname/$theirbranch"
}
.zshrc
to load all bash functions..zsh/functions
directory full of files like git-fork-pull
. So heres what a minimal source script looks like in your .bashrc
or .zshrc
to source all your custom functions.# .zshrc
CUSTOM_FUNCTIONS="$HOME/.zsh/functions"
for function in "$CUSTOM_FUNCTIONS"/*; do
source $function
done
~/.zsh/functions
directory and source them for use by zsh. This could look identical in a .bashrc
as well and using ~/.bash/functions
.