Q:

Pushed to my forked Github repo but didn't update my local from the main repo beforehand

I have this project with another developer. We both use GIT and have Github accounts with his repo as the main repo and mine as a fork of his.
I was assigned to do a task, where after I implemented my task, committed and pushed to my fork of his repo. Then I asked for a pull request. But on the other hand, the other developer made his changes to his repo and pushed to his Github before I did. So in the end, my committed code didn't have his changes.
What is the proper way to grab his changes and update the code for the pull request I made?

A:

a pull request does not mean "overwrite what you have with what i offer in the pull request". it means "apply the changes in my pull request on top of what you currently have". so what you describe is perfectly normal and expected and nothing should be changed about it.
the only inconvenience that might happen, is that if the changes are interdependent you might end up with conflicts that need to be resolved during the merge (i.e. when incorporating the pull request). again, this is perfectly normal and expected and nothing should be changed about it.
if however you want to do the conflict resolution yourself (instead of the other developer), you need to pull his changes and then either do the merge or rebase your patches to his latest version.

