How do you keep executing an [alias] even though there is an error?

FreakingPingo January 4, 2018

Hi all,

I have created the following alias so we more quickly can setup projects as part of our pipeline.

git config --global alias.setupforktemplate !git remote add old-origin $1 && git lfs fetch --all old-origin && git lfs push --all origin && git lfs pull

What it does it fetches the LFS data from a source repo and re-push the LFS data to a fork from the source repo. The problem with this is that it will certainly produce errors midway. It even says so in the guide "Git LFS files are not copied when a repo is forked"

This error is expected and is not a problem because the remaining part of the alias will resolve the issue. The problem is, when the error is triggered the execution of the alias is halted midway. Is it possible to do something that allows me to continue executing the alias even though an error occurs?

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events