git pull is not robust.

Now I use `git rev-parse --abbrev-rev HEAD` to get the branch name, and
then `git reset --hard` to force the update to the last revision of the
branch.
This commit is contained in:
Laurent Rineau 2012-11-30 11:17:49 +01:00
parent 1078574aef
commit d4e0a891c0
1 changed files with 4 additions and 1 deletions

View File

@ -5,7 +5,10 @@ export LC_ALL
if [ -d "$1/.git" ]; then
pushd $1
git pull
branch=`git rev-parse --abbrev-ref HEAD`
echo "Git repository, in branch '$branch'"
git fetch
git reset --hard origin/$branch
popd
else
svn up "$1"