Unlike many of the other site in this guide, GitHub is less of a repository than a collaboration platform. As a result, there are fewer guidelines for submission; you won't have to ensure your files are formatted in a particular way, or wait for a review period to pass before your data goes public. This makes submission much simpler, but also means that adhering to optional best practices and agreeing on standards with your collaborators is particularly important.
To create a repository and upload files, you will first have to create a GitHub account. Once you are logged in, there are two different ways to create a repository in GitHub. For most situations, creating a new repository from the Web UI will be the easiest option, but assess the steps for both options below and determine what might be best for your project. Remember that it is best practice to start a new repository for each project you begin on GitHub, to avoid files from different projects getting confused.
The language on this page has largely been pulled from the GitHub documentation pages, and has been lightly edited for clarity and specificity to MSK.
In the upper-right corner of any page, select +, then click New repository.
You can choose to create a repository from an existing template by hitting “Choose a template” from the dropdown menu and then selecting a template repository
If you choose to use a template, select “Include all branches” to include the directory structure and files from all branches in the template
If you're not using a template, there are a number of optional items you can pre-populate your repository with. If you're importing an existing repository to GitHub, don't choose any of these options, as you may introduce a merge conflict. You can add or create new files using the user interface or choose to add new files using the command line later
Use the Owner dropdown menu to select the account you want to own the repository.
Give your repository a title, which should reflect the nature of your project, and an optional description with basic information about your code
Choose a repository visibility
Follow best practices for code sharing
Create a README file
Create a .gitignore file
Select a software license to determine your project’s terms of reuse
Click Create repository.
You can use query parameters to pre-fill form fields when creating a new repository. Query parameters are optional parts of a URL you can customize to share a specific web page view, such as search filter results or an issue template on GitHub. To specify values for the predefined query parameters, you must match the key and value pair.
Pre-filling form fields with a URL query may be useful if you often want to create repositories with the same default settings. For example, a PI may want each researcher in their lab to create a repository for code they develop for the lab with the same name, description and visibility. Using a URL query, the PI can create a link that pre-fills the repository name, description and visibility fields and share it with the whole lab.
You must have the proper permissions for any action to use the equivalent query parameter. For example, you must have permission to create a repository in an organization to specify the organization as the repository owner in a query parameter. For more information, see Repository roles for an organization.
If you create an invalid URL using query parameters, or if you don’t have the proper permissions, the invalid query parameters will be ignored and the rest of the URL will function as normal. If you create a URL that exceeds the server limit, the URL will return a 414 URI Too Long
error page.
GitHub suggests the following steps to ensure your repository will be clear and easy to use for your collaborators (as well as any future re-users of your code). Keep in mind these suggestions are only a stepping off point - communicating with your collaborators about shared standards and procedures will help avoid confusion when uploading files, pulling requests, and making changes.