You can find the image folder here
Creating a descriptive and expressive git history without the noise of many merge commits. Conflicts are resolved on each feature / edit branch.
- Always start by checking out the main branch first and get all updates from the origin:
!git checkout main && git pull
- Create feature / edit branch
git checkout -b yi-edit-name
, where yi would be your own initials and edit-name the edit or feature name. Please use snake case here. - Make commits to your branch with good commit messages with
git add
andgit commit
. - Push your branch to the remote origin with
git push -u origin
. - Create a pull request on GitHub/pulls
- Once you’re done, prepare your branch for merging into main:
- Update the your local main with changes from the remote and switch back to your local feature branch:
!git checkout main && git pull && git checkout -
- Rebase your branch onto main:
rebase -i main
, -i is optional if you want to clean up your commit history. - If there are conflicts resolve them, and confirm them with
git add
andgit commit
and continue the rebase withgit rebase --continue
.
- Update the your local main with changes from the remote and switch back to your local feature branch:
- When you’re happy with the rebase push it with the --force option to the remote.
git checkout yi-edit-name
, to make sure you’re on the right branch and thengit push origin --force-with-lease
. - Request review on your pull request.
- Once you got the approval you can merge the changes into main with
git checkout main && git merge - --ff-only