I'm new to Git.
I created a brand new branch on a newly cloned repo. I want to push my work to the develop branch. I have only done 1 commit.
I did my work and did the following:
git add .
git commit -m "message"
git checkout develop
git pull origin develop
git checkout my-branch
git merge develop
git push origin develop
But I get the classic error:
! [rejected] develop -> develop (non-fast-forward)
error: failed to push some refs to '[email protected]:project/project.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
So I made sure my branch and develop were up to date - no worries, they are. So I tried again and got the same message.
I then made sure I don't have any other branches.
I'm not sure what else I can do. Would anyone know?