We have now covered branches, commits, pushes, Pull Requests, Issues, and CI/CD. To finish the tutorial, let's connect everything into one complete but still simple GitHub development workflow.
Suppose your team is building a website and someone discovers that the login button does not work correctly on mobile devices. They create a GitHub Issue:
#42 Fix login button on mobileYou are assigned to fix it.
Step 1: Update Local main
Before starting the work, make sure your local main is current:
git switch main
git pullThis prevents you from starting from an outdated version of the project.
Step 2: Create a Branch
Create a branch for the Issue:
git switch -c fix/mobile-loginThe branch name tells other developers what the work is about.
Conceptually:
main
\
fix/mobile-loginStep 3: Edit the Code
Now make the necessary changes.
Suppose the problem is in:
login.cssAfter editing the file, review the diff in VS Code to make sure there are no unrelated changes.
Then run:
git statusto check the repository.
Step 4: Add and Commit
When the changes look correct, stage them:
git add .Then create a commit:
git commit -m "Fix mobile login button"If the task requires several meaningful changes, you can create several commits.
For example:
Fix mobile login button
Add mobile login test
Improve login button spacingStep 5: Push the Branch
Push the new branch for the first time:
git push -u origin fix/mobile-loginThe branch now exists on GitHub.
Step 6: Open a Pull Request
Create a Pull Request with:
base: main
compare: fix/mobile-loginA good title might be:
Fix mobile login buttonThe description might say:
Fixes #42
The login button was covered by another element on small screens.
This PR updates the mobile layout and adds a test for the issue.The line:
Fixes #42links the Pull Request to the Issue.
Step 7: Code Review and CI
After the Pull Request is created, GitHub Actions may automatically run:
Lint
Tests
BuildAt the same time, another developer may review the code.
Suppose one automated check fails:
1 failing checkYou inspect the logs and discover that another change is required.
Return to your local branch:
git switch fix/mobile-loginmake the fix, then:
git add .
git commit -m "Fix mobile login test"
git pushThe existing Pull Request updates automatically, and GitHub Actions runs again.
Step 8: Merge
Once the reviewer is satisfied and GitHub shows:
All checks have passedthe Pull Request can be merged.
After the merge:
fix/mobile-login → main
Because the Pull Request contains:
Fixes #42GitHub can also automatically close Issue #42.
Step 9: Update Local main and Clean Up
The remote main now contains the merged work, but your local main still needs to be updated:
git switch main
git pullYou can then remove the finished local branch:
git branch -d fix/mobile-loginThe task is now complete.
Putting the Whole Workflow Together
The complete process is:
Find a problem → Create an Issue → Update main → Create a branch → Edit code → Review the diff → git add → git commit → git push → Open a Pull Request → Code review + CI checks → Fix problems and push again → Merge → Close the Issue → Update local main → Delete the branch
This may look like many steps, but the Git commands you repeat every day are actually quite small in number.
When starting work:
git switch main
git pull
git switch -c feature/my-featureAfter making changes:
git status
git add .
git commit -m "Describe the change"
git push -u origin feature/my-featureThen much of the workflow moves to GitHub:
Pull Request
Code Review
CI
MergeAfter the merge, return to your local repository:
git switch main
git pull
git branch -d feature/my-featureFor beginner-level Git and GitHub usage, this workflow is enough to handle many real development tasks.
What Have You Learned?
By completing this tutorial, you have learned more than a list of Git commands. You now understand a complete development workflow.
You know how to create or clone a repository, use Add and Commit to record changes, use branches to isolate work, and use Push and Pull to synchronize your local repository with GitHub.
You also understand the most common GitHub collaboration tools: Issues, Pull Requests, code review, and GitHub Actions.
The entire tutorial can be reduced to one core workflow:
Issue → Branch → Edit → Add → Commit → Push → Pull Request → Review + CI → Merge
You do not need to memorize every Git command at once. What matters most is understanding how the steps connect. With regular use, these operations gradually become a natural part of everyday development.
KNOWLEDGE QUIZ
Practice
Issue #42 requests password-length validation on the login form. Design the complete workflow from updating main through final branch cleanup, including the branch name, commands, PR content, CI/review, and post-merge steps.