Git rebase -i origin master "fatal: requires a single revision of invalid ascendant origin"

I am working on a Ruby project with a friend who has โ€œco-authorโ€ privileges in my Github.

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

The git rebase -i origin master command gave 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 SO this error, but none of them fully meet the criteria for this problem.

+5
source share
1 answer

The error indicates that git-rebase expects only one referent, not two. And the source is not a link.

You forgot the slash between the original and the master.

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

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

If you want to replicate your own repository, you only need to write a branch or link without telling any repository.

+6
source

All Articles