Making a Pull Request to remote upstream after deleting local .git folder

115 Views Asked by At

I recently deleted my local .git folder. When trying to make a new PR to my remote/upstream, I can't because I've deleted my own local git history and I'm getting this message when trying to Compare and Open a PR:

There isn’t anything to compare. X:master and myRepo:x_branch are entirely different commit histories.

How can I merge the upstream's commit history to mine, then submit the new code that's in the PR?

I am thinking of rebasing, but I'm not certain if that would do it.

1

There are 1 best solutions below

0
On

You would need to

  1. Re-clone the repository into a new folder
  2. Checkout the same point in time that you started making changes
  3. Merge your files into the new cloned repository
  4. Verify your changes with git status and git diff

This will allow you to remake your changes at the proper point in time and then you can push your changes to the server and submit a PR