================================================================================
                        Git feature development workflow
================================================================================

--------------------------------------------------------------------------------
                                 Initialisation
--------------------------------------------------------------------------------

1. Update local main branch

$ git checkout main
$ git pull origin main

2. Create branch feature

$ git branch feature/new-feature-name
$ git switch feture/new-feature-name
$ git push -u origin feature/new-feature-name

--------------------------------------------------------------------------------
                                Making a change
--------------------------------------------------------------------------------

1. Change file module.txt

$ git add module.txt
$ git commit --message "New feature within module"
$ git push

--------------------------------------------------------------------------------
                             Keep updated with main
--------------------------------------------------------------------------------

1. Update main branch

$ git switch main
$ git pull origin main

2. Merge main into feature branch

$ git switch feature/new-feature-name
$ git merge main

3. Resolve conflict if any

$ git add conflict.txt
$ git commit --message "Merged main with conflict corrected"
$ git push

--------------------------------------------------------------------------------
                       Merge the feature into main branch
--------------------------------------------------------------------------------

1. Update main branch

$ git checkout main
$ git pull origin main

2. Merge feature branch (--no-ff keeps track of a feature branch)

$ git merge --no-ff feature/new-feature-name
$ git push origin main

--------------------------------------------------------------------------------
                                    Cleanup
--------------------------------------------------------------------------------

1. Delete branches

$ git branch --delete feature/new-feature-name
$ git push origin --delete feature/new-feature-name

2. Verify

$ git branch --list
$ git branch --list --remote
