I am new to git.
At work we have a remote repository which I pull to make changes in my local before pushing back up.
Just want to confirm that my work process is correct.
- git fetch to get all the changes to origin/master
- git checkout -b newbranch origin/master
- git merge origin/master (when I am on the current branch I am working on)
This is the process I have been doing to do my work but I keep getting this annoying error:
error: failed to push some refs to 'ssh://xxxxx'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
I determined that it has to be due to the way I set up my work.
Please help!