https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow

https://nvie.com/posts/a-successful-git-branching-model/

<aside> šŸ’” The core idea behind the Feature Branch Workflow is that all feature development should take place in a dedicated branch instead of theĀ main branch. This encapsulation makes it easy for multiple developers to work on a particular feature without disturbing the main codebase. It also means theĀ main branch will never contain broken code, which is a huge advantage for continuous integration environments.

</aside>

A. Workflow

1. Start with the main branch

2. Create a new-branch

3. Update, add, commit, and push changes

4. Rebase

5. Push feature branch to remote

6. Pull request

7. Resolve feedback

8. Merge your pull request

Example

Mary wants to create a new feature:

  1. Starts with an updated local main branch:

    git checkout main
    git pull origin main
    
  2. Creates and checkout a feature branch:

    git checkout -b mary/feature/profile_dashboard main
    
  3. Commits :

    git commit -m 'feature: added global rank to profile dashboard'
    git commit -m 'fix: bug preventing display global rank on profile dasboard'
    [...]
    
  4. Rebases :

    git fetch origin main
    git rebase origin/main
    
  5. Pushes changes upstream :

    git push -u origin mary/feature/profile_dashboard