1

The current branch is myBranch and it is 2 commits behind master. I want to rebase it, so I tried

$ git rebase master

Current branch myBranch is up to date.


$ git push --set-upstream origin myBranch

Branch myBranch set up to track remote branch myBranch from origin.
Everything up-to-date

It seems everything I try, I get "it's up to date"

Anyone in this situation?

aynber
  • 22,380
  • 8
  • 50
  • 63
Marian A
  • 21
  • 1
  • 1
  • 2
  • 2
    How do you determine that the branch is '2 commits behind master'. If the remote `master` branch contains more commits then look at [this post](http://stackoverflow.com/questions/27828404/why-does-git-status-show-branch-is-up-to-date-when-changes-exist-upstream) for instructions on how to update your branch(es) – osowskit Dec 29 '16 at 00:08
  • Are you *sure* it's behind? What happens when you perform `git fetch`? – Makoto Dec 29 '16 at 01:10
  • Sounds like `myBranch` is not behind `master`. Try doing `git rev-parse master` and `git merge-base myBranch master`. If those two commands yield the same SHA-1, then `myBranch` is not behind `master`. – Alderath Dec 29 '16 at 08:42
  • I see that the current branch is behind master on the site where I forked the repository. There is **Request to merge marian-ald:cabal into master (2 commits behind)**, where cabal is branch name. – Marian A Dec 29 '16 at 08:50
  • I get the same SHA-1. It seems you are right. I'm wondering why on the web page where I see my branch it's 2 commit behind master. :( [link](https://gitlab.com/coala/package_manager/merge_requests/7) – Marian A Dec 29 '16 at 09:03

2 Answers2

0

Try using git rebase origin/master

renegadeborealis
  • 284
  • 1
  • 3
  • 9
  • 1
    This does not provide an answer to the question. Once you have sufficient [reputation](http://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](http://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](http://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/low-quality-posts/14727904) – plasmacel Dec 28 '16 at 23:53
  • 3
    @plasmacel doesn't it answer the question? – renegadeborealis Dec 28 '16 at 23:57
  • 1
    Your answer is too short, suggesting a "maybe try this" solution, which should be a comment. Otherwise please explain what did the OP do in a wrong way, and why is your solution works better than that, giving a more meaningful and informative context for your answer. – plasmacel Dec 29 '16 at 00:17
0

Please check the" git remote -v" And check the Origin . if this is not set, set the origin as master and rebase again

jAvA
  • 557
  • 1
  • 8
  • 22
  • I get this at _git remote -v_: **origin git@gitlab.com:marian-ald/package_manager.git (fetch) origin git@gitlab.com:marian-ald/package_manager.git (push)** – Marian A Dec 29 '16 at 08:40
  • it seems from the above comments it is not a issue , so you got what you are looking for ? or still the question open? – jAvA Dec 29 '16 at 17:12
  • This is a confusing answer because you can't set the `remote` `origin` to the `master` branch. – astrochun May 15 '21 at 12:12