0

I have an old fork in github which is left behind master on https://github.com/apache/jmeter

This branch is 15740 commits ahead

How do I discard all my changes?

I tried also to pull using GitHub Desktop, but it doesn't make any difference

Also it seems that I can only rebase using my forked project and not the origin github project

EDIT

Tried using answers and failed

git remote add upstream https://github.com/apache/jmeter.git

git fetch upstream

git checkout master

return error:

error: pathspec 'master' did not match any file(s) known to git.

if I continue ignoring the error then push origin master --force returns error:

src refspec master does not match any.

overcome command line error using different answer in using

git checkout -t -b master

But then last push failed

[remote rejected]       master -> master (permission denied) error: failed to push some refs
Ori Marko
  • 56,308
  • 23
  • 131
  • 233

1 Answers1

1

If the solution from the post doesn't work and you don't need the changes anymore, you can also delete your repository. To do this, go to the Settings tab in your repository. You will find the button Delete this repository at the bottom:

github danger zone

A new fork can then be created.

flaxel
  • 4,173
  • 4
  • 17
  • 30
  • Are you using GitHub Desktop? I don't see delete option – Ori Marko Apr 11 '21 at 13:43
  • I am directly on github.com. Did it work for you? – flaxel Apr 11 '21 at 13:43
  • Upvoted, but I hope there is a better way to simply rebase from master without getting into this danger zone ( removing all my previous project changes) – Ori Marko Apr 11 '21 at 13:48
  • Yes definitely. :D It's funny, but it's nice that you were able to solve the problem first. I will take a look at the evening if I find the mistake. – flaxel Apr 11 '21 at 13:49
  • overcome command line error using answer in https://stackoverflow.com/questions/5989592/git-cannot-checkout-branch-error-pathspec-did-not-match-any-files-kn using `git checkout -t -b master` , but then last push failed `[remote rejected] master -> master (permission denied) error: failed to push some refs` – Ori Marko Apr 11 '21 at 14:50
  • Have you configured your branch from the fork as a protected branch? Is that the complete error? What do you get as output for the command: `git remote -v`? – flaxel Apr 11 '21 at 17:41