lauragift21
lauragift21

Reputation: 117

Can I delete a commit in a pending Pull Request

I sent in a PR to a remote repo and discovered I had the commit from a previous PR included is it possible to delete this unwanted commit?

Upvotes: 2

Views: 2798

Answers (4)

Charu Jain
Charu Jain

Reputation: 36

Under your repository name, click Pull requests. In the "Pull Requests" list, click the pull request you'd like to close. At the bottom of the pull request, below the comment box, click Close pull request.

Then to revert the last commit or revert to the SHA of the commit ,you can use the command git revert HEAD~1 or git revert (get the commit id from git log)

Upvotes: 1

Masoud
Masoud

Reputation: 1064

You can rebase your branch and update your pull request. Take a look to this link and it'll help to how to remove the commit

Upvotes: 0

Tim Biegeleisen
Tim Biegeleisen

Reputation: 522762

You may close a pull request from the GitHub website:

You may choose to close a pull request without merging it into the upstream branch. This can be handy if the changes proposed in the branch are no longer needed, or if another solution has been proposed in another branch.

  1. Under your repository name, click Pull requests.
  2. In the "Pull Requests" list, click the pull request you'd like to close.
  3. The close Pull Request buttonAt the bottom of the pull request, below the comment box, click Close pull request.
  4. Optionally, delete the branch. This keeps the list of branches in your repository tidy.

Upvotes: 0

Mike Kor
Mike Kor

Reputation: 876

You can make a revert commit for unwanted commits. In this answer should be enough info.

Upvotes: 1

Related Questions