Dead lyricist Robert Hunter wrote the words for this one. Jerry Garcia wrote the music.
In Hunter's book Box of Rain, he includes a note at the bottom of the page for the "Here Comes Sunshine" lyrics. It reads:
Remembering the great Vanport, Washington flood of 1949, living in other people's homes, a family abandoned by father, second grade
There's a lot to unpack in that one vague line, but the first interesting thing about the note is that it's there at all. Only a few of the hundreds of lyrics in the book have such notes appended to them. "Here Comes Sunshine" must have been a personally significant song for Hunter.
Remembering the great Vanport, Washington flood of 1949...
Hunter gets the details slightly wrong here. The flood occurred in 1948, not 1949, and Vanport was in Oregon, not Washington (which borders northern Oregon). His mistake is understandable because the flood wiped Vanport out completely more than 40 years before Hunter published Box of Rain in the pre-internet days of 1990.
Vanport was a makeshift town thrown together to house the families of the men and women working in the shipyards during the tense days of World War II (which the United States entered in 1941 following the Japanese attack on Pearl Harbor). The entire town was built in only 110 days in 1942. Its population peaked at around 40,000 people, making it for a time the second-most populated city in the state of Oregon.
On May 20, 1948, a combination of heavy rainfall and unusually high amounts of snowmelt from higher elevations caused massive flooding in the Columbia River. Around 4:17 p.m., a berm broke and a 10-foot-high wall of water descended on Vanport.
Fortunately that day was Memorial Day and many families were gone for the holiday. Of those that remained, most had enough warning to escape the danger zone. In the end, only 15 of the tens of thousands of residents died.
The event inspired Congress to pass the Flood Control Act of 1950. Portland's Delta Park now stands on the site that used to be Vanport.
...living in other people's homes, a family abandoned by father, second grade
It's not clear exactly why Hunter tied the story of Vanport to his own childhood. What we know is that he was born in Arroyo Grande, California, on June 23, 1941, and so would have been seven years old during the flood, putting him right in second grade as the note from Box of Rain says.
We also know that this was the time that Hunter's biological father, who was an alcoholic, abandoned the family. In the aftermath of his father's departure, Hunter bounced around some foster homes for a few months. He eventually got back to his mother, who married publisher Norman Hunter. Perhaps it was during this time that Hunter found himself in a foster home near Vanport.
Whatever the case, the note he left suggests that the flood tied in with his own life in some emotional way.
The lyric, "Line up a long shot, maybe try it two times" may refer to Hunter's mother marrying twice. "Asking you nice now, keep the mother rolling" is also almost certainly a reference to his Hunter's mother, though the rest of the verse is a bit ambiguous and open to interpretation.
The Wake of the Flood album takes its title from this song's first line. "Here Comes Sunshine" is the first track on the second side of the album.