What is the difference between "here we go" and "there we go"?

Solution 1:

J.R. mentioned a distinction that applies in some cases and noted that because of the wide range of uses of the two phrases, there might not be a “universal way to differentiate when one should be used instead of the other”.

Another distinction (similar in that it applies in some cases but far from all) is that “Here we go” is frequently inclusive of the speaker, and “There we go” frequently is not. A very few of the examples of “Here we go” and “There we go” found in A Collection of Confusible Phrases by Yuri Dolgopolov illustrate this: snip from Yuri's book

Another distinction is that “here we go” is found 10 times more commonly (in Google Books English-language corpus) than is “there we go”, and many instances of the latter are irrelevancies like “From there we go to Spain”.

Solution 2:

Here we go; I'll take a stab at this:

Here we go is used more when an event is about to take place, while there we go is used more after the event has already started. There we go also seems to carry the connotation that everything is going well so far.

That said, both of these expressions can be used in a wide variety of contexts, so I'm not sure there's any universal way to differentiate when one should be used instead of the other in all situations.

There you go, I hope that helps.