Here is my project structure
MainProject
|  README.md
|  src/
|  lib/      # this is a submodule
When I develop MainProject, I will also develop lib/, I mean MainProject/lib/.
When I do push, I will copy all changes in MainProject/lib/* into MainProject/../lib/, which is a separate  git directory, then push.
After that I will do a submodule update in MainProject/lib/ to latest from remote. 
Then I will commit and push changes in MainProject.
It suffers. How do you develop along with a git submodule?
ADD
I want all changes in lib/ pushed to remote lib repository.
And all changes beside lib/ in MainProject pushed to remote MainProject.
So if I directly put to remote lib repository inside MainProject/lib
And then add and commit and push changes beside lib/ in  MainProject to remote.
If someone else clone MainProject and do submodule update, will he get the latest sources?
My .gitmodules:
 [submodule "lib"]
    path = lib
    url = git@github.com:XXX/YYY.git
    branch = master
 
     
    