I searched this but unable to find my answer. And I just want to know the non command line way to do this.... Or is there any other way to achieve this same ?
You can delete files (from a repo you own, like a fork)
But you cannot directly from the web interface delete commits.
For that you would need to clone, do an interactive rebase (dropping the commits you don't want) and git push --force
.
Even a revert does not seem possible.
The OP adds:
Actually I have 3 branches one is
master
and rest two arepatch-1
andpatch-2
and I messed up withmaster
branch before creatingpatch-1
andpatch-2
branches so some useless commits are also cloned frommaster
topatch-1
andpatch-2
branch so please can you help me to delete those commits which are cloned frommaster
?
No without cloning the repo though:
git clone /url/of/your/fork
cd yourfork
git remote add upstream /url/original/repo
git fetch upstream
git checkout -b patch-1 origin/patch-1
git checkout -b patch-2 origin/patch-2
Then replay your patches on top of upstream master
:
git rebase --onto upstream/master master patch-1
git rebase --onto upstream/master master patch-2
Finally reset master
to the upstream master
branch:
git checkout master
git reset --hard upstream/master
And then push everything back to your fork:
git push --force --mirror
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments