Git Flow
Workflow methodology for Git version control, defining branch structures and release processes to streamline collaborative development and maintain stable production code.
Merging Feature Branches (without rebase)
main: A---B---C
feature: D---E
==> merge the feature branch into the main => new merge commit (M) i
main: A---B---C-------M \ / feature: D---E---/
Merging Feature Branches (with rebase)
main: A---B---C
feature: D'--E'
--> commits D and E are replayed on top of commit C --> fast-forward merge without a merge commit main: A---B---C---D'--E'
Note: rebasing can cause conflicts and confusion if multiple developers are working on the same branch, as it rewrites the commit history. Merging is safer in these cases but results in a more complex history with merge commits. Choose the approach that best suits your team's workflow and preferences.
- Make sure you are on the latest #develop branch.
- Create a local branch with a name starting with "feature":
- git checkout -b feature/new-functionality
- Commit the changes
If develop changes in the mean while, rebase your commits on develop:
1.git checkout develop && git pull 2. git checkout feature/new-functionality && git rebase develop 3. git push origin feat/new-functionality
Created on 8/9/2019