Git swirl fixation on remote

I am trying to use cherry to commit from github.

https://github.com/angular/angular.js/commit/469b750019adb193f2b973ab841ac87d0d06d4f2

As far as I can tell, it is not part of any active branches. I tried this in my local repo:

git remote add upstream https://github.com/angular/angular.js.git git fetch upstream git cherry-pick 469b750 

I get this error

 fatal: bad revision '469b750' 

Am I trying to do this? I searched for lost, orphaned and undistributed deals, but I did not find anything that helped. I could just copy / paste this and do it with it, but I'm trying to save a story and learn more about git. Thanks.

+5
source share
3 answers

It will not be exactly the cherry pick, but you can apply this fix as follows:

  • Add .patch to the Github url and save it as a git patch file:

     wget https://github.com/angular/angular.js/commit/469b750019adb193f2b973ab841ac87d0d06d4f2.patch -o new.patch 
  • Apply this commit to your tree with git am :

     git am new.patch 

The result of this should be identical to the selection of cherries.

+5
source

This is a really interesting problem. I myself tested it locally, and the commit is not displayed in reflog --all , so it is not only orphaned, but also not downloaded from Github to pull, clone or fetch. This may be the case when it is completely lost forever, if you do not load it manually and return it to the tree.

https://help.github.com/articles/commit-exists-on-github-but-not-in-my-local-clone/

+1
source

I looked in a bit bag for a specific deal that a colleague made today, and then went to my command line to let the cherry choose what to commit (and a number of other commits) to another experimental git branch. I noticed that I missed this error "fatal: bad revision" ####### ''. Because, although it was in a bitbucket, it was not in my local git repository ... I did a "git pull" to get these commits, and then the cherry worked. This can be the solution to most problems with this Im guessing error.

0
source

Source: https://habr.com/ru/post/1204992/


All Articles