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.

22 lines
315B

  1. #!/bin/bash
  2. if [ ! -d ".git" ]; then
  3. echo "err: not a git repository"
  4. exit
  5. fi
  6. url=$(git remote -v | grep fetch | sed 's/\t/ /g' | cut -d' ' -f2 | sort | uniq)
  7. lines=$(echo "$url" | wc -l)
  8. dir=$(pwd)
  9. if [ "$lines" != "1" ]; then
  10. echo "err: too many remotes"
  11. exit
  12. fi
  13. cd ..
  14. rm -rf $dir
  15. git clone $url
  16. cd $dir