I use git pull to ensure that local repos are up to date. However, git pull sometimes fails. git pull fails if you have uncommitted changes. Is there a git, or shell, option to ensure that if the commands fails the rest of the script continues?
The script currently is:
if [ -d "some-repo" ]; then
cd "some-repo"
git pull
#RESCUE????
else
git clone git@github.com:USERNAME/some-repo.git
cd "some-repo"
fi
I don't want to checkout a branch, and I don't really care about the work going on in different branches. I know it is possible to do a git reset --hard, or use a --force command but i want to make sure it is safe, and that code doesn't get lost.
