Work on GitHub

español

It’s time to add your file to the repository:

gif of directions

  1. In your new branch, add a new file named: _pins/YOUR-USERNAME.json.
  2. Enter the following content into your file:

    ---
    githubHandle: YOUR-USERNAME
    latitude: YOUR_LATITUDE
    longitude: YOUR_LONGITUDE
    ---
    
  3. Scroll down and enter a commit message that describes your addition.
  4. Commit your change to your branch.
Tell me why

Add a New File

To add your pin, add a new file to the class repository. We gave you specific instructions above, but first consider some of the helpful ways GitHub allows you to add files to your projects.

  • File Uploader: if you already have a file on your computer that you would like to add to your repository, simply drag and drop it in to the repository window on GitHub.
  • Create New File: you can also choose to create a new file in your repository by clicking the Create new file button. This opens a simple, web-based file editor. First, provide a file name with the appropriate file extension. The file extension will tell GitHub how to render your content.
  • Modifying an Existing File: Sometimes you simply need to make a change to an existing file. If this is the case, navigate to the file using the file directory in the Code tab. Once you have opened the file, click the pencil icon in the top right to open the file in edit mode.

Commit Your Changes

When you are finished creating or making changes to a file on GitHub, scroll to the bottom of the page. There, find a Commit new file section.

In the first field, type a commit message. The commit message should briefly tell others about the changes you are introducing to the file.

Rules to Live By For Commits:

  • Don’t end your commit with a period.
  • Keep your commits to 50 characters or less. Add extra detail in the extended description window, if necessary. This is located just below the subject line.
  • Commits use the imperative mood. Add instead of Added. Merge instead of Merged.
  • Think of your commit as expressing intent to introduce a change.

Choose Your Branch

Next, designate where you want your changes to be committed. If you were on your branch when you clicked the Create new file button, GitHub will prompt you to commit directly to that branch. But, if you forgot to create a new branch, you can do it now.

Stuck? Open an issue in the repository for this class and mention @githubteacher for help from one of the GitHub trainers!
Continue