Skip to content

Instantly share code, notes, and snippets.

@watsy0007
Created May 19, 2016 12:57
Show Gist options
  • Save watsy0007/d2263a887fbacc1a599a4747329bc1b0 to your computer and use it in GitHub Desktop.
Save watsy0007/d2263a887fbacc1a599a4747329bc1b0 to your computer and use it in GitHub Desktop.
git subtree封装
function fetchcore() {
return $(echo $(git fetch core))
}
function pulcore() {
if [[ -z fetchcore ]] then
local branch
if [[ $1 ]] then
branch=$1
else
branch=release
fi
echo $branch
git subtree pull --prefix=subapp/core core $branch --squash
else
echo 'no changes'
fi
}
function pshcore() {
if [[ -z fetchcore ]] then
local branch
if [[ $1 ]] then
branch=$1
else
branch=release
fi
echo $branch
git subtree push --prefix=subapp/core core $branch --squash
else
echo 'no changes'
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment