GitHub absolutely does not require that. If GitHub required you to grant them nontransferrable ownership of code hosted there, that would be insane and nobody would use it. Thankfully it's much more reasonable. :)
Here's what GitHub actually says:
> We need the legal right to do things like host Your Content, publish it, and share it. You grant us and our legal successors the right to store, parse, and display Your Content, and make incidental copies as necessary to render the Website and provide the Service. This includes the right to do things like copy it to our database and make backups; show it to you and other users; parse it into a search index or otherwise analyze it on our servers; share it with other users; and perform it, in case Your Content is something like music or video.
> This license does not grant GitHub the right to sell Your Content or otherwise distribute or use it outside of our provision of the Service.
Here's what GitHub actually says:
> We need the legal right to do things like host Your Content, publish it, and share it. You grant us and our legal successors the right to store, parse, and display Your Content, and make incidental copies as necessary to render the Website and provide the Service. This includes the right to do things like copy it to our database and make backups; show it to you and other users; parse it into a search index or otherwise analyze it on our servers; share it with other users; and perform it, in case Your Content is something like music or video.
> This license does not grant GitHub the right to sell Your Content or otherwise distribute or use it outside of our provision of the Service.