Skip to main content
added 179 characters in body
Source Link
CustardBun
  • 3.9k
  • 11
  • 45
  • 87

So I'm working on a project with some teammates and I have rebased on their changes, but is there a way to remove their commit (just locally - not planning to push it this way) and add it back at will?

** Edit: Clarification, I don't want to combine the commit with my commit, I just want to make it as if that commit has never happened (remove any changes from that commit, etc)

Commit A: Commit that both of us got out Commit B: His commit <- want to locally remove just this commit Commit C: My commit 

I had thought about making a branch and just sticking my commit on the branch and not pulling in his change onto that branch, but I was wondering if there was a cleaner way that wouldn't involve a separate branch?

Thanks in advance!

So I'm working on a project with some teammates and I have rebased on their changes, but is there a way to remove their commit (just locally - not planning to push it this way) and add it back at will?

Commit A: Commit that both of us got out Commit B: His commit <- want to locally remove just this commit Commit C: My commit 

I had thought about making a branch and just sticking my commit on the branch and not pulling in his change onto that branch, but I was wondering if there was a cleaner way that wouldn't involve a separate branch?

Thanks in advance!

So I'm working on a project with some teammates and I have rebased on their changes, but is there a way to remove their commit (just locally - not planning to push it this way) and add it back at will?

** Edit: Clarification, I don't want to combine the commit with my commit, I just want to make it as if that commit has never happened (remove any changes from that commit, etc)

Commit A: Commit that both of us got out Commit B: His commit <- want to locally remove just this commit Commit C: My commit 

I had thought about making a branch and just sticking my commit on the branch and not pulling in his change onto that branch, but I was wondering if there was a cleaner way that wouldn't involve a separate branch?

Thanks in advance!

Source Link
CustardBun
  • 3.9k
  • 11
  • 45
  • 87

Git - How to locally remove a single commit a few commits back?

So I'm working on a project with some teammates and I have rebased on their changes, but is there a way to remove their commit (just locally - not planning to push it this way) and add it back at will?

Commit A: Commit that both of us got out Commit B: His commit <- want to locally remove just this commit Commit C: My commit 

I had thought about making a branch and just sticking my commit on the branch and not pulling in his change onto that branch, but I was wondering if there was a cleaner way that wouldn't involve a separate branch?

Thanks in advance!