The origin of "joshin"

I’m wondering what the origin of the phrase “just joshin ya” is. It doesn’t make a whole lot of sense to me…

Probably it should be more accurately written with an apostrophe at the end: “joshin’” as short for “joshing” – which would be the present participle of “to josh”

M-W.Com has this to say:

Perhaps some of our etymological detective Dopers might be able to dig out something more on origins of the phrase, first usage, etc.

According to The Word Detective, it’s from an old synonym for “rube” or “hick,” derived from the name Joshua, which was thought of as a rural name in the 18th century.

He also lists a couple of other possibilities which he considers unlikely, including an amusing one having to do with a man named Josh Tatum who perpetrated a scam with fake coins.

The OED says it comes from Josh Billings, a very popular American humorist. Sort of the Dave Barry of his day. But Billings started writing sketches in 1860 and the OED’s first cite is from 1845. So that can’t be right. Since “Josh Billings” was a pen name, it seems more likely that he chose “josh” because of the word.

My WAG: a humourous substitution, joking -> joseph king -> joshua king -> joshing.