Loading...

What steps do you take to update files once they are uploaded?

It's alive! But what if you want to make some changes? Click through the tabs below to see how to update, edit, and delete items from your GitHub repository.

young woman working at a computer

The easiest way to make changes is to edit your files locally and then re-upload them to your repository.

For example, let's say you have made some edits to your local copy of assignment1.html. To update the file online, return to your browser, navigate to your GitHub repository, and click the BasicWebDev folder:

This will take you inside your directory folder, showing everything housed in this folder.

You can drag/drop your new assignment1.html file directly into this screen, and it will upload, overwriting the previous version. Once the file has finished uploading, scroll to the bottom of the page and click on the Commit changes button.

Now, when you return to your page URL, refresh your screen. You should see the changes you made.

Remember, sometimes it takes a few minutes for the changes to go live. If you don't see your changes right away, come back in a few minutes and refresh the page in your browser.

Another way of updating files in your site is to edit them directly in GitHub.

For example, let's add some HTML links to your README.md file. To edit this file, navigate to your GitHub repository and click the README.md file.

Clicking the file will bring you to the code-editing window for the file. To edit the file, click on the pencil icon located toward the right side of the screen.

This will open the HTML view. From here, you can edit the file. Since your README.md file is the default page shown when you visit your main website (for example, https://username.github.io), you can use this file as a landing page that points to your assignments by adding links for those pages. Try adding your name in a heading tag and a link to an HTML file.

We will use assignment1.html as an example:

Creating a relative link to the assignment1.html file from the README.md file will allow you to navigate directly to the assignment from the https://StudentName321.github.io URL.

After you are finished with your edits, scroll to the bottom of the page and click the Commit changes button. Now, you can return to your main website (e.g., https://username.github.io), and your changes should appear in a few minutes.

Editing an HTML file can also be done in the same way. The biggest drawback to editing an HTML file in GitHub is that the file will no longer match your local copy. If you were to make edits in GitHub to an assignment file and then upload another version from a local file, you would override any edits you made in the repository. This is why it's best practice to edit HTML files locally and upload your changes.

If you need to delete a file from your repository, click on the file you want to delete as if you are going to edit it. Then, click the trashcan icon located toward the right of your screen.

Then, scroll to the bottom of the page and click the Commit changes button.

To delete an entire folder, click on the folder name in your repository. This will bring you to the contents of your folder. To delete the entire folder, click on the three dots in the upper right and choose Delete directory.

Scroll to the bottom of the page and click the Commit changes button.

Question

What is the one step that all three of these tasks have in common?

You have to click the Commit changes button to push updates to your repository.