When you put code on GitHub, you retain all the copyright to your code. However, you do grant GitHub a license to host the code, and you also allow GitHub users a set of rights - namely the ability to look at, and fork your repository.