Skip to content

Instantly share code, notes, and snippets.

@allenyang79
Created April 6, 2020 08:49
Show Gist options
  • Save allenyang79/edb7e087b1bc2392da1947ce62a1af05 to your computer and use it in GitHub Desktop.
Save allenyang79/edb7e087b1bc2392da1947ce62a1af05 to your computer and use it in GitHub Desktop.
#!/bin/bash
current_branch=$(git rev-parse --abbrev-ref HEAD)
if [[ ${current_branch} == "master" ]]
then
echo "pull ${current_branch}"
git fetch
git pull origin ${current_branch}
elif [[ ${current_branch} == "staging" ]]
then
echo "pull ${current_branch}"
git pull origin ${current_branch}
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment