For example I have a .gitconfig
for one project, since I do a lot of code reviews, that reads:
review = "!f(){ git checkout master && git pull origin master && git branch -D $1 && git fetch && git checkout $1 && git pull origin $1 && bundle install && rake db:migrate && git checkout -f; };f"
Now I know it's a little overkill and I don't need it all but I like it that way. It makes me feel like the review branch is totally clean. Sometimes it's nice to see the message Already up-to-date.
Now when the branch does not exist yet then git branch -D $1
will fail and it throws an error and doesn't run the rest of the commands.
Is there a way that I can make the rest of the commands run even if one of the commands fail?