Check out example codes for "Updates were rejected because a pushed branch tip is behind its remote". It will help you in understanding the concepts better.

Code Example 1

// if this don't work
git pull origin FixForBug
git push origin FixForBug
// then, do this:
git push -f origin FixForBug

Code Example 2

git push -f origin master

Learn ReactJs, React Native from akashmittal.com