resolve git conflicts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
315 B

#!/bin/bash
if [ ! -d ".git" ]; then
echo "err: not a git repository"
exit
fi
url=$(git remote -v | grep fetch | sed 's/\t/ /g' | cut -d' ' -f2 | sort | uniq)
lines=$(echo "$url" | wc -l)
dir=$(pwd)
if [ "$lines" != "1" ]; then
echo "err: too many remotes"
exit
fi
cd ..
rm -rf $dir
git clone $url
cd $dir