Add .gitignore or LICENSE to non-empty Repo in Github
If you have some existing files on your local machine that you want to add to a new repository on Github, I find it easier to do the follow:
- Create an empty repository on Github.
- Follow the instructions (displayed in the browser after creating the repository) to add local files.
When creating a new repository on Github, there are options for:
- Initialize this repository with a README
- Add .gitignore with a dropdown of templates
- Add LICENSE with a dropdown of templates
Even after creating the empty repository, there are still links to creating these files. If you follow the instructions for adding the local files, you lose those links. The valuable parts are the dropdowns of templates for .gitignore and LICENSE! Here is how you get access to these dropdowns!
- Click on the + link for creating a new file (or browse to https://github.com/<username>/<repository>/new/<branch>)
- Enter the name .gitignore or LICENSE and the dropdown will appear at the far right in-line with the UI for the file name
Just what I wanted, but not very easy to discover.