How to Upload Files to GitHub
This guide shows you how to add CSV files and other content to your GitHub repository using the web interface.
When You Need This
- You need to upload your metadata CSV file
- You want to add transcript files to your project
- You need to upload images or other media files
Step 1: Navigate to the Correct Directory
- Go to your repository
- Open your GitHub repository in your web browser
- Navigate to the destination folder
- For metadata: Click on the
_data
folder - For transcripts: Navigate to
_data
, then create or enter thetranscripts
folder - For images: Click on the
objects
folder
- For metadata: Click on the
Step 2: Upload Your Files
Option A: Upload Existing Files
- Click “Add file” button at the top of the file list
- A dropdown menu will appear
- Select “Upload files” from the dropdown menu
- The file upload interface will appear
- Add your files
- Drag and drop files from your computer onto the upload area
- OR click “choose your files” to select files using your file browser
- You can upload multiple files at once
- Commit your changes
- Scroll down to the “Commit changes” section
- Add a descriptive commit message
- Example: “Add metadata and transcript files” or “Upload interview images”
- Click “Commit changes”
Option B: Create a New File
This is useful for creating small files like CSV files directly on GitHub:
-
Click “Add file” button at the top of the file list
- Select “Create new file” from the dropdown menu
- A text editor will open
- Name your file
- Type the filename in the field at the top
- Include the proper extension (e.g.,
.csv
,.md
) - For transcripts, type
transcripts/filename.csv
to create in the transcripts subfolder
- Add your content
- Type or paste your file content in the main editor area
- For CSV files, ensure comma-separated formatting is maintained
- Commit your new file
- Scroll down to the “Commit new file” section
- Add a descriptive commit message
- Click “Commit new file”
Step 3: Verify Your Upload
- Check that your files appear in the directory
- GitHub will return you to the folder view
- Your newly uploaded or created files should appear in the list
- Click on a file to verify its contents
- CSV files will be displayed in a formatted table view
- Images will be displayed as previews
Important Tips for OHD Files
Metadata File
- Upload to the
_data
directory - Filename should match what’s in your
_config.yml
(typicallymetadata.csv
) - Ensure it has all required fields (objectid, title, display_template)
Transcript Files
- Upload to the
_data/transcripts
directory - Filenames must match the objectid values in your metadata
- Example: If objectid is “smith_john”, filename must be “smith_john.csv”
Creating the Transcripts Folder
If the transcripts
folder doesn’t exist yet:
- Click “Add file” → “Create new file”
- Type “transcripts/placeholder.csv” in the name field
- Add some sample content
- Commit the file to create the folder
- You can delete this placeholder file later
Common Issues and Solutions
Problem | Solution |
---|---|
File too large | GitHub has a 100MB file size limit; consider external hosting for large media |
Upload failing | Try uploading fewer files at once |
CSV displaying incorrectly | Verify your CSV format; avoid Excel and use Google Sheets or plain text editors |
Transcripts not showing on site | Check that filenames exactly match objectids in metadata |
Next Steps
After uploading your files:
- Configure your site if you haven’t already
- Publish your site to make it accessible online
- Test your site to ensure everything works correctly