What do you mean by "temporarily" - what purpose does it serve, what willl you 
do with the result..?

One method is to start a fresh branch from the tip of the current branch and 
immediatelt 'revert' the commit you want removed. The resulting worktree (file 
system contents) will be as if it had been removed, and you can do your tests 
etc. Note that this still leaves that original commit in place, its just that 
you reversed its effects.


If you go the 'rebase' root, I'd suggest creating a branch name at the tip of 
the original branch, so you still have the old branch for comparison. 
Conceptually 'rebase' is destructive as you move the whole branch (but leaves 
hidden markers to the old one, and the repo will still have the commuts 
available until garbage collection happens in a couple of weeks time), so may 
not match your 'temporary' purpose.

Philip

Remember, new branches cost nothing! (Ok, so it's a 40 byte file, but that's 
still nothing)
  ----- Original Message ----- 
  From: hellboy 
  To: Git for human beings 
  Sent: Monday, September 05, 2016 8:59 AM
  Subject: [git-users] How to remove commit from branch


  How can I (temporally) remove commit from branch if this commit is not the 
last in the history


  -- 
  You received this message because you are subscribed to the Google Groups 
"Git for human beings" group.
  To unsubscribe from this group and stop receiving emails from it, send an 
email to git-users+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to