GitHub workflow summary
0. Start Git
git init
1. Get the most recent version of master.
git pull
2. Crate new branch which will allocate new feature.
git branch <name-of-branch>
3. Check the branch was successfully created.
git branch
4. Switch to the newly created branch.
git checkout <name-of-branch>
5. Make the changes in the code that are related to the new feature.
6. Check de changes are being tracked by git.
git status
7. Add the new changes.
git add -A
8. Commit new changes.
git commit -m "commit message"
9. Check we are working on the branch that we are supposed to work on.
git branch
10. Before doing the pull request, make sure the new branch does not conflicts with the main.
git checkout master
git pull
11. If there are conflicts, go back to the feature branch and merge master to the branch.
git checkout <name-of-branch>
git merge master # Here a conflict message should display
12. After conflicts are solved (or there are no conflicts at all), add the new changes.
git status
git add -A
git commit
13. Push changes to GitHub.
git push
git push --set-upstream origin <name-of-branch>
14. Go to GitHub and click the "Create Pull Request" button, so the code can be inspected (reviewed) by co-workers.
15. Once the code has been reviewed (and corrected), click the "Merge Pull Request" button on GitHub.
16. Delete old branch, if needed.
17. Switch to master and pull the updated version of it.
git checkout master
git pull
18. Rinse and repeat.