SHARE
TWEET

Untitled

a guest Sep 20th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. mkdir -p $HOME/bin && export PATH=$PATH:$HOME/bin && printf '#!/bin/bash\n\nif [[ ! $1 ]]; then\n  echo "Error: Argument 1 should be string containing the name of the branch"\n  exit 1\nfi\n\nis_remote_branch=$(git branch -a | grep -m 1 $1 | grep origin)\nbranch_name=$(git branch -a | grep -m 1 $1)\n\nif [[ ! $branch_name ]]; then\n  echo "Error: cant find branch $1"\n  exit 1\nfi\n\nif [[ $is_remote_branch ]]; then\n  git checkout --track ${branch_name/"*"/}  \nelse\n  git checkout ${branch_name/"*"/}\nfi\n' > $HOME/bin/gitc && chmod +x $HOME/bin/gitc
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top