A Step-by-Step Guide to Updating a GitHub Project
GitHub can seem complicated when you first begin using it, but the everyday routine for updating a personal project is fairly simple.
This guide walks through the complete process, beginning with signing in to GitHub and ending with confirming that your changes were uploaded successfully.
It assumes that Git is already installed, the project has already been connected to a GitHub repository, and you are using Visual Studio Code or a similar code editor.
Step 1: Sign In to GitHub
Open a web browser and go to:
Select Sign in in the upper-right corner of the page.
Enter your GitHub username or email address and your password. If two-factor authentication is enabled, GitHub may also ask you to enter a verification code or approve the sign-in attempt.
Signing in through the website allows you to open your repository and later confirm that your changes were uploaded.
Step 2: Open Your Repository on GitHub
After signing in, open the repository for your project.
You can usually find it by following these steps:
- Select your profile picture in the upper-right corner.
- Select Your repositories.
- Select the name of the repository you want to update.
Leave the repository open in a browser tab. You can return to it after pushing your changes.
Step 3: Open the Project on Your Computer
Open Visual Studio Code.
Select:
File > Open Folder
Choose the main folder for your project.
You should open the project folder that is connected to GitHub. This folder contains your project files and a hidden folder named .git.
The hidden .git folder contains the information Git uses to track the project and connect it to the GitHub repository.
Step 4: Open the Terminal
In Visual Studio Code, select:
Terminal > New Terminal
The terminal will normally open near the bottom of the Visual Studio Code window.
Check the folder path displayed in the terminal. It should point to the project folder you opened.
For example, it might look something like this:
C:\Users\YourName\Documents\MyProject>
Git commands should be entered while the terminal is working inside the correct project folder.
Step 5: Pull the Latest Version from GitHub
Before beginning work, enter:
git pull
Press Enter.
The git pull command checks GitHub for newer changes and brings them down to your computer.
If there are no newer changes, Git may display:
Already up to date.
Even when you are the only person working on the project, running git pull before starting is a useful habit. It becomes especially important when you work on the same project from more than one computer.
Step 6: Make Your Changes
You can now edit the project.
This might include:
- Editing a webpage
- Adding a new feature
- Correcting spelling or formatting
- Updating Python code
- Adding a new template
- Fixing a problem
Save each file after making changes.
Step 7: Test the Project
Before sending your changes to GitHub, test the project carefully.
For a website, this might mean starting the local development server and opening the site in a browser.
For a Flask project, the command might be something such as:
flask run
The exact command depends on how the project is configured.
Check that the pages load properly and that the feature you changed behaves as expected.
Testing before committing helps prevent broken or incomplete work from being added to the project history.
Step 8: Check Which Files Changed
Return to the terminal and enter:
git status
Press Enter.
The git status command shows the current state of the project.
It may list:
- Files that were changed
- New files that were created
- Files that were deleted
- Files that are ready to be committed
Review the list before continuing.
This gives you an opportunity to make sure you are not about to upload anything that should remain private, such as:
- Passwords
- API keys
- Private configuration files
- Temporary files
- Database files containing private information
Projects commonly use a file named .gitignore to tell Git which files should not be tracked.
Step 9: Add the Changed Files
To prepare all changed files for the next commit, enter:
git add .
Press Enter.
The dot means that Git should add all changed files in the current project folder and its subfolders.
This step does not upload anything to GitHub. It simply selects the changes that will be included in the next commit.
Step 10: Check the Files Again
It is often helpful to run git status again:
git status
Files that have been added will normally appear under a heading such as:
Changes to be committed
This confirms that the files are ready for the commit.
Step 11: Create a Commit
Enter the following command:
git commit -m "Describe the change"
Replace Describe the change with a short explanation of what you changed.
For example:
git commit -m "Add locations section to initiative page"
Another example might be:
git commit -m "Fix spacing in location names"
A commit is a saved checkpoint in the history of the project.
The commit message should briefly explain what the checkpoint contains. A useful message makes it easier to understand the project history later.
A vague message such as this is not very helpful:
git commit -m "Changes"
A more specific message is better:
git commit -m "Add edit button for linked location notes"
Step 12: Push the Commit to GitHub
After creating the commit, enter:
git push
Press Enter.
The git push command sends the new commit from your computer to the GitHub repository.
In practical terms, this is the step that uploads your committed work to GitHub.
The first time you push from a computer, GitHub may ask you to authenticate.
Depending on how Git is configured, you may be asked to:
- Sign in through a browser
- Approve access for Git Credential Manager
- Use an SSH key
- Use a personal access token
GitHub does not normally accept your regular GitHub account password directly inside the terminal for Git operations.
For many Windows users, Git Credential Manager opens a browser window and guides them through the sign-in process.
Step 13: Confirm the Changes on GitHub
Return to the GitHub repository in your browser.
Refresh the page.
The latest commit message should appear near the top of the repository.
You can also open the files you changed and confirm that the updated versions are now visible on GitHub.
This final check confirms that the push was successful.
The Five Main Git Commands
The five Git commands used in this routine are:
git pull
git status
git add .
git commit -m "Describe the change"
git push
Each command has a specific purpose:
git pullbrings the latest version down from GitHub.git statusshows which files have changed.git add .prepares the changed files for a commit.git commitcreates a local checkpoint.git pushsends the checkpoint to GitHub.
The Complete Routine to Remember
A useful way to remember the full process is:
- Sign in
- Open the repository
- Open the project
- Pull
- Work
- Test
- Check
- Add
- Commit
- Push
- Confirm
In a shorter form:
Pull > Work > Test > Add > Commit > Push
Git and GitHub include many advanced features, but this basic routine is enough for much of the everyday work on a personal project.
Following the same steps each time helps create a reliable project history and keeps the GitHub repository up to date.