I have a use case in gitlab where I have to create a branch say testdemo
from master
, since master
is default branch, we are making master protected.
A team of 6 developers is working on testdemo
branch (which is feature
branch),
Developer A does some commit to branch using git push -u origin HEAD:ref/for/testdemo
where the merge request is yet to raised by Developer A.
Parallely, Developer B adds new file and tries to push to the same branch using git push -u origin HEAD:ref/for/testdemo
.
I am getting the below error :
hint: Updates were rejected because a pushed branch tip is behind its remote hint: counterpart. Check out this branch and integrate the remote changes
How can I solve this? My use-case is that developers commit to ref/for/testdemo
and code review happens and then it is merged to testdemobranch
. How can I achieve this when two developers make a parallel commit or developer does amend to current commit?
Thanks,
Saikrishna