1

I need to merge request from my develop branch to master in a remote repo, but my merge request is rejected because I have 10 commit ahead master. My local master branch is up date and my local develop branch is up date too. The problem of these 10 commits ahead appears only in remote remote branch.

I try

How can I clean or delete or solve these 10 commit ahead in my remote develop branch?

PD: My repo is on gitlab. Thanks for your helps. Regards

kergrau
  • 61
  • 3
  • 8
  • 1
    Did you try `git rebase master` on your development branch ? – Shmulik Klein Sep 27 '18 at 14:51
  • Well, I try git rebase master and don't works for me, then I did git push but increase to 18 commit ahead. But anyway thanks for your help – kergrau Sep 27 '18 at 15:14
  • Run `git fetch` to update all your remote-tracking names (this is safe to do at any time). Being *ahead of* your remote-tracking name is normal. If you are *behind* your remote-tracking name, you can use `git rebase` or `git merge` to deal with these states. It's possible to be both ahead *and* behind, in which case `rebase` or `merge` will do something nontrivial, and it's important to decide which of these two methods you prefer. – torek Sep 27 '18 at 17:41
  • @kergrau did you ever resolve it? After banging my head against this problem with someone else who knows git better than I do, the decision was that it was a gitlab bug. – Wellspring Jul 03 '19 at 13:11
  • @Wellspring Unfortunalety no. But thanks for your help. – kergrau Jul 03 '19 at 21:32
  • You didn't get any help from me. I wish you had, because that'd mean I made progress on it myself. Which I didn't. For now it seems my options are to delete the branches wholesale and recreate them (not cool) or just ignore the thing that's telling me I have stuff not yet pushed to master (also not cool).Third option is for Gitlab to fix their bug. Waiting for that... – Wellspring Jul 04 '19 at 22:50
  • @kergrau note this spot where you can add your name to the list... https://gitlab.com/gitlab-com/support-forum/issues/4608 – Wellspring Jul 04 '19 at 23:16

2 Answers2

0

I would suggest:

  1. Commit local changes to your branch.
  2. >git pull origin master
  3. >git rebase origin master
  4. Resolve conflicts if any and commit.
  5. Push the changes from your local to your remote branch
  6. Raise a pull request.

A suggested read: https://www.atlassian.com/git/tutorials/comparing-workflows

Atul
  • 2,673
  • 2
  • 28
  • 34
  • I followed yours steps but... when I did git pull, I got Already up-to-date. then with the git rebase I got current branch master is up to date. And when I pushed I got everything is up to date. – kergrau Sep 27 '18 at 15:28
  • @kergrau That's strange. Could you try >git branch -vv and see if you are tracking rightly. And that you are raising pull request for correct branch. – Atul Sep 27 '18 at 15:40
0

I suggest this step by step procedure:

  1. git checkout master
  2. git pull
  3. git checkout branchX
  4. git merge master
  5. git push
  6. Create pull request from branchX to master
tymtam
  • 31,798
  • 8
  • 86
  • 126