1

I have dev-master branch & I have created new branch - feature_10 and started working on it for a feature. I have completed my task and then executed below command -

git add *.java

git commit -m "comment"

git checkout dev-master

git merge feature_10

git push origin feature_10

This commit is visible on repository (web) but I am not able to raise NEW MERGE REQUEST on web as the feature_10 branch is not listing in branch drop-down box.

I have executed wrong command steps, I should have 1st pushed the branch and then should executed merge command.

Now how to correct it ? Please advise ?

Santosh
  • 782
  • 4
  • 15
  • 38

1 Answers1

0

First, you shouldn't merge your feature_branch into dev_master.

You should do your merge request (as you intended to) form the remote side, branch feature, and wait for dev_master to be updated with it in the original repo that you have forked.

Then you can pull from that original repo in order to update your dev_master, and push that updated version to your fork (web). And you can delete your feature branch, since it has been accepted and integrated into dev_master in the original repo.


Regarding the push, check;

  • the git config push.default policy.
    With recent git, make sure it is set to 'simple'.

  • check the branch config upstream branch, to see if it wasn't already set to antoehr branch.

    git config branch.feature_10.merge
    git config branch.feature_10.origin
    
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Is it okay to revert or undo the merge ? It's already pushed on remote with same branch name. – Santosh Sep 14 '13 at 10:06
  • 1
    @Santosh if you are pushing to *your* fork, meaning nobody else pull from it, you can reset locally, redo your local history right, and `git push --force`. – VonC Sep 14 '13 at 10:20