Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git rebase -i origin master "fatal: Needed a single revision invalid upstream origin"

Tags:

git

github

I am working on a Ruby project with a friend who has "collaborator" privileges in my Github.

  • He issued a pull request from his branch (separate from the master).
  • I merged his pull request into the master branch.
  • I then issued the command on the command line git rebase -i origin master.

The git rebase -i origin master command threw me the following error:

devil@DEVil:~/repos/ruby_bank$ git rebase -i origin master
fatal: Needed a single revision
invalid upstream origin

There are other questions on S.O. this error, but none of them quite meet the criteria of this problem.

like image 716
Erik Åsland Avatar asked Aug 08 '15 19:08

Erik Åsland


1 Answers

The error is telling that git-rebase expects only one referente, not two. And origin is not a reference.

You forgot the slash between origin and master.

git rebase -i origin/master
  • origin is the name of the repository.
  • master is the branch of the repository.

You can have several branches. Then the slash is telling git which branch of the repository is the one you want to rebase.

When you want to do a rebase of your own repository you only need to write the branch or reference without telling any repository.

like image 166
blashser Avatar answered Sep 17 '22 16:09

blashser