a. Switch to Greet Branch:
git checkout Greet
b. Pull Latest Changes :
git pull origin mainc. and lastly merge main into Greet
git merge maina. Switch to Greet branch:
git checkout mainb. 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 stashand then stash them back when you get back to this branch
git stash applya. Switch to Greet branch:
git checkout Greetb. 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.shd. Commit the merge:
git commit -m "Resolved conflicts in hello.sh"a. Switch to Greet branch:
git checkout Greetb. Rebase onto main:
git rebase mainfirst Switch to main branch: and then carry out the merging process.
git checkout mainMerge Greet:
git merge Greet