Git is a version control system. It helps us keep track of changes, work in parallel, and review code. Git is an industry standard tool that almost everyone in the software engineering world uses. Github helps us manage our git repositories.
- Do NOT commit large changes directly to master/main
- Make PRs, code review is good
- Keep PRs small, so they're easier to review
- Rebase before merging PRs
These ideas are based around making a clean history, and having good code review. eg:
------------------------- main
\___/\___/\___/\___/\___/ branches with changes
Commands you may forget but are extremely useful.
git checkout -b new-branch
> creates and checks out the branch "new-branch"git checkout new-branch
> check existing branch "new-branch"git rebase main
> rebase your current branch onto maingit pull
> fetch new updates from the git server