Although the enharmonic key of A-flat major is preferred because A-flat major has only four flats as opposed to G-sharp major's eight sharps (including the F), G-sharp major appears as a secondary key area in several works in sharp keys, most notably in the Prelude and Fugue in C-sharp major from Johann Sebastian Bach's The Well-Tempered Clavier, Book 1.
The A-flat major key is generally preferred due to its fewer flats compared to G-sharp major's eight sharps (including F), yet G-sharp major still holds significance as a secondary key area in various works, particularly in Bach's Prelude and Fugue in C-sharp major from The Well-Tempered Clavier, Book 1.