Learn step-by-step how to upload PDFs and other files to GitHub using the web UI or Git command line. Discover tips for commit messages and file organization.
Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
Step 1: Prepare or create your GitHub repository
Before uploading any files, you need a repository on GitHub. You can create a new one or use an existing repository.
my-documents
), optionally add a description, and choose public or private.
Step 2: Choose the upload method – Web UI or Command Line
GitHub offers two main ways to upload files:
Step 3: Upload files via the GitHub web interface
This method is ideal if you just want to drag and drop one or a few PDFs, images, or other files.
Add file
dropdown, then choose Upload files
.
Commit message: Add project PDF
Description (optional): Uploading the project documentation PDF file.
Commit directly to the main branch
is selected (or choose a new branch).Commit changes
.Your PDF is now part of the repository. You can click the filename to view it directly in the browser.
Step 4: Upload files using Git on your local machine
This method uses the command line to manage files in bulk and track changes.
username
and my-documents
with your details:
git clone https://github.com/username/my-documents.git
cd my-documents
cp ~/Downloads/myfile.pdf .
git add myfile.pdf
git commit -m "Add myfile.pdf documentation"
git push origin main
Replace main
with your default branch name if it’s different (for example, master
).
Step 5: Verify the upload on GitHub
Once the push completes or your web UI commit finishes, return to your repository page on GitHub:
Additional tips and best practices
.gitignore
file if you have temporary or machine-generated files you don’t want to upload.When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.