-
Clone project you want to work with
git clone repo_URL
-
Make sure that you are working with the latest version. Pull the newest code.
git pull origin main
-
Start working with your branch and switch to it
git checkout -b my_branch_name
-
Make changes you want and then add changes to staging
git add .
-
Commit your changes to staging
git commit -m "what those changes were about"
-
Push your branch to remote repo. Please note that you might have multiple commits done before you push it.
git push origin my_branch_name
-
On remote repo (GitHub page), you have now one pushed branches. The next step is to compare changes and pull request for merge changes to main.
-
Write comments if needed and create pull request.
-
You can specify reviewer to send a notification to them for checking your code. If there are no conflicts, you can easily merge pull request.
-
After the merge, you can delete your branch.
-
When you continue to contribute to this project, start over from step 2.
In a nutshell:
- checkout main to be in the right branch
- pull main
- create and switch to a new branch
- add changes
- commit changes
- push your new branch
- in GitHub, review the code and if all good, merge it
- delete branch
Checklist is written based on The Net Ninja tutorial