I am contributing to a public repo. I cloned the repo and created a new branch cmd_addons
. I wanted to commit a few changes after some days but my changes are getting rejected. These are the steps that I have followed:
(Assuming I am on the cmd_addons
branch)
1. git pull upstream master && git push origin master
2. git add 'somefile'
3. git commit -m "..."
4. git push origin cmd_addons
This keeps throwing error Updates were rejected because your current branch is behind its remote counterpart. Integrate the remote changes
After this I tried git pull
but it says that everything is upto date.
PS: I already looked at this issue and this one. I am unable to understand what is the correct way of doing it without losing anything.