Berets of the United States Army
U.S. Army Special Forces wear the green beret because of their link to the British Commandos of World War II. The first Ranger unit, commonly known as Darby's Rangers, was formed in Northern Ireland during the summer of 1942. On completion of training at the Commando Training Depot at Achnacarry Castle in Scotland, those Rangers had the right to wear the British Commando green beret, but it was not part of the regulation uniform at the time and was disallowed by the U.S. Army. 
The 10th Special Forces Group (Airborne) had many veterans of World War II and Korea in its ranks when it was formed in 1952. Members of the 10th SFG began to unofficially wear a variety of berets while training, some favoring the red or maroon airborne beret, the black beret, or the green commando beret. In 1953, a beret whose design was based on that of the Canadian Army pattern, and which was rifle-green in color, was chosen for wear by Special Forces units.
1st United States Sharpshooters
The most notable aspect of the Berdan Sharpshooter uniform is the green color, rather than the standard Union blue. They were one of only a few regiments that went outside the typical Potomac Army's uniform. The green uniform gave the sharpshooters the clear advantage of camouflage, but also sometimes was a disadvantage because they were easy to distinguish against the rest of the Union soldiers for Confederate marksmen to spot and target. Sharpshooters were high-priority kills amongst the Confederate army, because they had such high skills and good salvageable equipment. Sharpshooters used more guerrilla warfare battle tactics than the rest of the Union infantry. Along with the green uniform, a soldier was to have no brass on any of their buttons. Their shoes were standard Union issue, but their pants were made of green wool just like the frock coats, with a pair of gaiters. Furthermore, Sharpshooter knapsacks were a Prussian-style fur sack fitted over a wooden frame, as opposed to the usual tarred canvas. However, as the war went on the men were not reissued this clothing and many of the men received standard federal clothing making them harder for rebel troops to notice their elite capabilities. By the Gettysburg campaign most of the men were wearing modified blue uniforms.