GitHub without the command line
Knowing your way around the command line is a very important developer skill. There may still be times when you'll want to interact with GitHub directly or through GitHub Desktop (a graphical user interface (GUI) for GitHub.) Whether you're a designer who needs their own copy of a project directory or a developer student not on the Front-end developer career track, GitHub can be a fantastic tool to keep a copy of your project and its history.
Note: If you are a developer student, we strongly recommend using the command line instead of uploading files directly to GitHub. Developers use the command line frequently, so it's good to practice and become comfortable with it early. We have a course in the Front-end developer career track to help you get set up and exercises to learn the skills you need.
GitHub allows you to keep track of changes to your code - called a version history. It also makes sharing code easy with a link. Let's look at how you can upload files and folders directly to GitHub:
- Start by signing up for GitHub: https://github.com
On your dashboard or in the Repositories tab there's a green "New" button to create a new repo (short for repository.) Click the button to create a new repo.
You'll see a page similar to this:
- Give the repository a name using all lower case letters and with dashes instead of spaces between the words. It's nice to add a description; but don't change any other settings. Click the green "Create repository" button at the bottom of the window.
After clicking the button, you'll see a page like this with multiple options to connect your local project folder with the GitHub repo. Click on the link for "uploading an existing file":
- You'll see the page below where you can drag and drop your project folder or the contents of your project folder.
- If you're working through the Python course, you can upload the entire project folder for the class.
- If you want to create a GitHub Pages version of a site that uses HTML, CSS, and JavaScript, with no database, you'll upload the project folder's contents. Uploading the project folder's contents will place the index.html file in the root where the server can find it to render the GitHub Pages site.
After dropping the folders and/or files it will take a moment for them to upload. Once they are uploaded, click the "Commit changes" button at the bottom of the window.
Committing the changes may also take a bit. When the changes are committed, you'll see the homepage for the repo. If you ever need to upload additional files of folders, click on the "Add file" dropdown and choose "Upload files". If you usually work through the command line, before the next push to GitHub you'll pull down the commit you just created and merge it into your local repo.
- When you want to share your code for a feedback challenge or if you have questions, you can send a link to the repo like this one: https://github.com/twosavoie/trial-repo-for-wendy. We'll be able to download your code and go from there!
Now you have an additional way to utilize GitHub - Awesome!!