Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #/bin/sh
- _git=`git`
- repository=$1
- branch=master
- working=`pwd`/../../../script/Central
- # Move to Central unbare.
- OLD_GIT_DIR=$GIT_DIR
- cd $working
- GIT_DIR=?`pwd`/.git
- $_git checkout $branch
- # Get current SHA-1.
- checkpoint=`$_git rev-parse HEAD`
- # generate commit message with merged history
- CUSTOM_MSG="[auto] Merge from repository
- `$_git log --pretty=format:' • #%h — %s (%an, %cd)' --reverse --date=short \
- $checkpoint..lib-$repository/$branch`
- ---
- `$_git log -1 --pretty=format:'%B'`"
- $_git fetch "lib-${repository}"
- # Merge!
- $_git merge -m "$CUSTOM_MSG" -Xprefix="Library/$repository" lib-$repository/$branch
- # Push to Central bare.
- $_git push
- # Reset.
- GIT_DIR=$OLD_GIT_DIR
Add Comment
Please, Sign In to add comment