The Air is the second movement of Bach's Orchestral Suite No. 3 in D major, BWV 1068, a set of dances for strings, oboes, trumpets and timpani; the Air itself is for strings alone, two violin parts, viola and continuo. The earliest surviving parts date from around 1730, when Bach was working in Leipzig, though the music may be older.
The nickname came much later. In 1871 the German violinist August Wilhelmj arranged the melody for violin and piano, transposed so that the violinist could play it entirely on the lowest string of the instrument, the G string. His arrangement was so popular that Air on the G String became the everyday name of Bach's original too.
This transcription: J. S. Bach, Orchestral Suite No. 3 in D major, BWV 1068 (c. 1730), Air, bars 1-6 (second ending): the first violin as printed (short grace note in bar 2 left out, the grace note before the A written as an eighth note), the continuo reduced to one note per beat: Bach-Gesellschaft edition, vol. XXXI (1), Orchesterwerke (Leipzig: Breitkopf & Härtel), p. 54 - archive.org bach-gesellschaft-ausgabe, BGA Band 31, image 0073.
Transcribed by GOONS Studio from the original work, which is in the public domain.