How To Add Files To Your Github Repository Via Github Desktop
Photo by Roman Synkevych πΊπ¦ on Unsplash
In this article, I will show you how to create a new repository on GitHub.com and how to add files to this repository through the GitHub Desktop APP.
To follow the tutorial, you must have a GitHub.com profile and must have installed the GitHub Desktop APP on your computer.
If you don't have the GitHub desktop app, you can open this link in a new tab on your browser to download it.
This tutorial was created on the Windows operating system.
CONNECT GITHUB DESKTOP APP TO GITHUB.com
- Open the GitHub Desktop application.
- Choose File > Preferences.
- On the Accounts tab, click Sign in on the GitHub.com row.
- Type your username and password and click the Sign in or Sign in using your browser.
CREATE A GITHUB REPOSITORY
- Go to your profile on GitHub.com and click the green New button to create a repository dialog page
- In the repository dialog page, type your repository name of choice. I will set my repo's name as FordGoBike-data-visualization.
- Type in a short description of the repository, a summary of the information the files in the repo will provide the reader.
- Depending on your preference, you can decide who can or cannot see your repo. Click the Public radio button to make your publicly visible.
- Click Add a README file
- Select a type of License for the repository. I use the MIT License.
MIT License allows people to do almost anything with the code they find in your project. These include being able to take a copy, make changes (or not) and distribute it as a closed-source version. That means anyone can distribute the software as an application without giving their users access to the code.
- Click Create repository button, and it makes a repository on your GitHub.com account just like mine.
In this new repository, you only have the README.md and LICENSE file. Continue reading to learn how to add files from your computer to a new repository through GitHub Desktop APP.
ADD FILES TO GITHUB.COM REPOSITORY VIA GITHUB DESKTOP
- Click the Code button and, on the dropdown menu, click Open with GitHub Desktop in the dropdown menu.
- The GitHub Desktop app will launch automatically, click Clone and wait a moment for the new repository to be downloaded into your computer
To clone a repository is to download a copy to your computer.
Now you have a clone of the repository you created on GitHub.com on your computer.
- To view the downloaded repository files in Explorer, click Show in Explorer button.
- Navigate to the folder on your computer where you kept the files you want to upload to your new repository, copy all the files and paste them into the repository folder (see above for how to open the repository folder in Explorer)
- Close the Explorer window, and the GitHub Desktop APP refreshes to show the new files you have included on the left sidebar.
The box that says "Summary (required)" is where we type in the title of the upload ( remember that uploading a file to GitHub.com is done through what is known as a commit).
- Type "docs: Initial commit" as the commit title. And we can leave the description blank.
Because this is the first time uploading to the new repository, we can write this name as the commit title. For future commits to this repository, you should give an appropriate title that reflects the purpose with a description that explains the what and why.
- Click Commit to the main button, then click the Push origin button and wait for the files to upload.
It is best practice to always create a branch repository before pushing a commit, but since this is the first ever commit to this repository, we will upload directly to the
main
branch. To learn more about branching, read here
- Once the upload is complete, click the View on GitHub button to see your uploaded files on your GitHub.com repository.
We have come to the end of this tutorial. If this was helpful, please share so it can help others and encourage me to do more like it.
Thank you for your time.