Branching
Branching
The process of evolving multiple versions of software in parallel.
Branching allows for the creation of new branches for experimental features, while team works on another branch.
A merge conflict is when two branches have changed the same code, and the RCS cannot decide which changes to keep. In those cases, the conflicts will have to be resolved manually.
Syncing branches
To sync branches, a merge between the branches can be used.
master
andfeature1
,master
can be merged intofeature1
Given two branches,
However, rebasing can also be done, but is not recommended in this course as it involves modifying past commits.
Pull Requests
Pull requests
Pull requests are a function in GitHub that allows contributors to propose a function, and get the code reviewed and added into the repository.
The PR lifecycle includes:
- the creation of the pull request
- the review of the pull-request
- changes can be merged if changes are approved by code reviewers
- request can be closed, if changes are rejected
- comments can be added to suggest further changes.
Reviewing PRs
On GitHub:
- Locate PR
- Read PR description
- Click on
Files to see diff
view- Used to see changes in code
- Add review comments
- Submit review with overall comment
Workflows
Bug-fixing
- Create separate branch in local repo
- Push the branch to fork
- Creates a pull request from that branch in her fork
- Pull-request review
- Merge PR
- Sync forks
RCS
Centralised RCS
Uses a central remote repo that is shared by team.
Distributed RCS
Allows multiple remote/local repos working together.
Feature branch flow
Better p