Intermediate Git
George Boorman
Curriculum Manager, DataCamp
Each branch should have a particular purpose
Once the task is complete, we incorporate the changes into production
main
branch - "ground truth"When merging two branches:
source
—the branch we want to merge fromdestination
—the branch we want to merge intoWhen merging ai-assistant
into main
:
ai-assistant
= source
main
= destination
git switch main
git merge source
From main
, to merge ai-assistant
into main
:
git merge ai-assistant
git merge source destination
git merge ai-assistant main
main
to create ai-assistant
main
to the last commit in the ai-assistant
branchIntermediate Git