Notably, all of these are examples of relatively static skirmishing and harassing and aren't when units are advancing and retreating (with the possible exception of Robertson's men's claims, if accurate).There are a few stories from Gettysburg, including these references:
-Christian Benner wrote: At the house next to ours on the road to town a Rebel sharpshooter had climbed up in a tree in the yard and buckled himself fast to a limb with his belt. He was picking off our men,and of course it wasn't easy for them to make out where he was because the thick leaves hid him. But at last they noticed a puff of smoke, when he'd sent a bullet among 'em ... that was the last shot he fired. They aimed at the place the smoke came from and killed him, and after the battle, I'll be dog-goned if he wasn't still in the tree hanging by his belt.
-A Confederate soldier climbed a lone oak tree about 400 yards west of Cemetery Ridge fired several rounds at Major Boynton of the 14th Vermont, without success. He was himself struck by a ball and tumbled out of the tree. (Edwin F. Palmer, The Second Brigade or Camp Life by a Volunteer)
-On July 3, the 2nd Pennsylvania Reserves were annoyed by another "tree frog," who succeeded in shooting several men. His location was finally discovered and two Union soldiers stole up on him while a third drew his attention. Getting under the tree, they shook it until the Rebel cried out that he would come down. (E. M. Woodward, Our Campaigns)
-Another was found hanging in the crotch of a tree with his head and feet dangling.
-Some men of Robertson's brigade were convinced that some close incoming shots fired at them near the Round Tops were from a Federal ensconced up a tree.
-A Rebel who hid himself in a tree was credited with wounding and killing several men in the Union Eleventh Corps, until he was claimed by a member of the 54th New York. (Skirmishers, by Thomas L. Elmore, The Gettysburg Magazine, issue no. 6)