Added readme file to remote repo not allowing push from local repo

Hi All,

I Initialized local git repo and created remote repo over to push local repo to remote. While creating remote I skipped creating readme file. I successfully pushed local repo to remote using the following commands:

git remote add origin

git push origin master

I found that I was able to push any changes from local to remote without fail.

From here I am not able to understand:

When I created readme file over remote repo then later I did some changes to my local repo this time when I tried to push the changes I got the following message:

fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

git push --set-upstream origin master

I want to know why this thing happened.
Also, tell me that can we do the changes from both sides i.e. from local as well as remote or we can only do the changes in local only then push that change to the remote. If can from both the side then how to go about this?

Better way is make changes in local repo, then push them.

Before making push, make pull changes from remote.

 About error  fatal: The current branch master has no upstream branch.

This could happen for example, if you deleted and then created branch again.