Reputation: 121
Somehow, I made a commit to the master branch and a different branch.
So the exact same commit ID is present for my master branch and the other branch.
I already created the pull request on the other branch to apply the changes to the upstream repo. (The pull request is not yet approved).
The problem is that I just found out that again, the same commit made in that PR is on my master branch. I figured that out after I made a new branch off of master and made a new commit for a different PR.
So now when attempting to make a new PR for this new branch, it includes the commit that was on the master since I made the branch off of master.
I want to know that if I delete the commit off of master branch, will it effect the commit made on the other branch that is in my active PR?
(because they are referenced to by the same commit ID)
Upvotes: 0
Views: 1144
Reputation: 592
Commit or resetting the head in separate branch remains in that branch itself. It is not auto replicated. You need to perform
git reset HEAD commit_id or git reset HEAD~1
on both master branch and the other branch that you have manually created.
Upvotes: 0
Reputation: 1326556
I want to know that if I delete the commit off of master branch, will it effect the commit made on the other branch that is in my active PR?
No it will not:
git reset --hard @~
) is a local operationUpvotes: 1