0

When I type git status, I have got this message:

Your branch is behind 'origin/mrp_v2' by 7 commits, and can be fast-forwarded.

How can I discard these 7 commits?

Daryl Wong
  • 2,023
  • 5
  • 28
  • 61
  • this might help https://stackoverflow.com/questions/3293531/how-to-permanently-remove-few-commits-from-remote-branch – Aneesh May 01 '22 at 15:36
  • Those aren't *your* commits. You are *behind someone else's commits*. Are you sure you want to throw away *their* commits, from *their* repository? – torek May 01 '22 at 16:53
  • @torek yes, I have like to discard those commits – Daryl Wong May 01 '22 at 16:55
  • OK, then the link @Aneesh gave is the right one: just use `git push --force` (or `--force-with-lease`). This assumes you have permission to change their repository like this, of course. – torek May 01 '22 at 16:55

0 Answers0