error: pathspec 'HEAD^2' did not match any file(s) known to git

168 Views Asked by At

I'm trying to make Pull Requests to collaborate with an existing repo, so I forked it, then clone it, make the changes, create a branch, add, commit and push, then go to my GitHub to "Compare & Pull Request". Everything looks fine, but then it can't be merge due to this error:

enter image description here

enter image description here

I don't know what's happening but I think it has something to do with the branches...

I'm new using git branches, and I have some questions:

  • do I have to switch to the branch before making the changes? Or can I make the changes first and then worry about the branches?
  • how can I fix this error? and, if I find a solution, do I have to Pull Request again? or can I fix the existing PR somehow?
  • I need a new branch for each new PR, right? When I'm able to delete a branch? when the merge is done? should I delete them?
0

There are 0 best solutions below