a. Switch to Greet Branch:
git checkout Greet
b. Pull Latest Changes :
git pull origin main
c. and lastly merge main into Greet
git merge main
a. Switch to Greet branch:
git checkout main
b. switch to the lib/ directory and make changes in hello.sh
N/B
you are in the parent directory :
cd work/hello/lib/
N/B
if all the changes in this branch are not yet committed then commit and push the changes. you can even temporarily save your work when moving to another branch
git stash
and then stash them back when you get back to this branch
git stash apply
a. Switch to Greet branch:
git checkout Greet
b. Attempt merge:
git merge main
- Resolving Conflicts:
a. Open hello.sh in a text editor. b. Manually edit the file: check on incomming changes
-
Keep desired changes from each branch. c. Stage the resolved file:
git add hello.sh
d. Commit the merge:
git commit -m "Resolved conflicts in hello.sh"
c. Stage the resolved file:
git add hello.sh
d. Commit the merge:
git commit -m "Resolved conflicts in hello.sh"
a. Switch to Greet branch:
git checkout Greet
b. Rebase onto main:
git rebase main
first Switch to main branch: and then carry out the merging process.
git checkout main
Merge Greet:
git merge Greet