OED2 has this as one of 8 (!) disparate entries for gammon:

slang or colloq.


1. Thieves' slang. In phrases to give gammon (see quot. 1720). to keep in gammon: to engage (a person's) attention while a confederate is robbing him.
1720 A. Smith Hist. Highwaymen III. 358 Give me Gammon. That is, to side, shoulder, or stand close to a Man, or a Woman, whilst another picks his, or her Pocket. 1821 D. Haggart Life 51 Going out at the door, Bagrie called the woman of the house, kept her in gammon in the back~room, while I returned and brought off the till. Ibid. 68, I whidded to the Doctor, and he gave me gammon.

2. Talk, chatter. Usually gammon and patter.
1781 G. Parker View Soc. I. 208, I thought myself pretty much a master of Gammon, but the Billingsgate eloquence of Mrs. PI not only exceeded me, but outdid all that I had ever known eloquent in that way. 1789 I Life's Painter (ed. 2) 186 Gammon and Patter, Jaw talk, etc. 1796 Grose's Dict. Vulgar Tongue, Gamon and Patter, commonplace talk of any profession; as the gamon and patter of a horse-dealer, sailor, etc.

3. Ridiculous nonsense suited to deceive simple persons only; ‘humbug’, ‘rubbish’.
1805 T. Harral Scenes of Life III. 105 ‘Come, come, none of your gammon!’ cried one, ‘tell us where the other black sheep is’. 1811 Lex. Balatron. s.v., What rum gamon the old file pitched to the flat. 1811 J. Poole Ham. Travestie 30 Come, that won't do, my lord;—now that's all gammon. 1837 Dickens Pickw. xxiv, Some people maintains that an Englishman's house is his castle. That's gammon. 1845 Disraeli Sybil (Rtldg.) 285 Morley has got round them, preaching moral force, and all that sort of gammon. 1870 H. Smart Race for Wife x, Come, old fellow, no gammon.

b. quasi-int. Humbug! Fudge!
1827 R. B. Peake Comfort. Lodg. i. iii, Sir H. (Aside) Gammon! 1855 Thackeray Rose & Ring xv, ‘Gammon!’ exclaimed his Lordship. 1885 F. A. Guthrie Tinted Venus 4 ‘Gammon!’ said Jauncey, ‘that isn't it’.