Re: I want delete fault commit from my git repository

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



chongyc <chongyc27@xxxxxxxxx> writes:

> I have found buggy commit object which I had committed into  git
> repository  wrongly
> 
> So I am going to delete it from my git repository
> 
> How to do it ?

If it is just created commit (and not yet published), use 
"git commit --amend" to correct it, or "git reset --hard HEAD^"
to just drop it.

If you have published history (somebody is relying on history
containing broken commit) the only way is to add commit reverting
changes brought by broken commit using git-revert.

If you can rewrite history, use "git rebase --interactive" and simply
remove the commit from instructions/series file if the commit you want
to remove is not too deep in history, or use git-filter-branch if
broken commit is somewhere deeper.  See documentation for details.

-- 
Jakub Narebski
Poland
ShadeHawk on #git
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux