This repository is a practical demonstration of common Git workflows for feature development, teamwork, and merging strategies. The task guides you through the creation and management of branches for proper version control and collaboration.
- Create and switch between multiple branches.
- Make and merge changes across branches.
- Simulate individual contributions in a team workflow.
- Resolve potential merge conflicts.
# Clone the remote repository
git clone <repo-url>
cd <repo-name># Create a feature branch and switch to it
git checkout -b feature
# Create a dev branch and switch to it
git checkout -b dev- Edit/add files on
devandfeaturebranches.
This commit is from the dev branch
This commit is from the feature branch
# Stage and commit changes
git add .
git commit -m "your commit message"# Push your branches to the remote repository
git push origin dev
git push origin feature- Merge changes from
featurebranch intodevbranch.
git checkout dev
git merge feature- If there are merge conflicts, resolve them in the files, then:
git add .
git commit -m "Resolve merge conflicts"- After development is complete, merge
devintomain:
git checkout main
git merge dev