Main menu:


Site search

My Wife’s Website

Recent Posts

Categories

Archives

December 2014
S M T W T F S
« Aug   Feb »
 123456
78910111213
14151617181920
21222324252627
28293031  

Links:

Meta

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:

  1. Create an empty repository on Github.
  2. 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!

  1. Click on the + link for creating a new file (or browse to https://github.com/<username>/<repository>/new/<branch>)
  2. 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.

Write a comment