Browse Source

initial commit

master
erinn 2 months ago
commit
14bb2ece01
1 changed files with 21 additions and 0 deletions
  1. +21
    -0
      gitfix

+ 21
- 0
gitfix View File

@@ -0,0 +1,21 @@
#!/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


Loading…
Cancel
Save