Is it possible to delete specific commits from forked repo by github website

Golu

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 ?

VonC

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 are patch-1 and patch-2 and I messed up with master branch before creating patch-1 and patch-2 branches so some useless commits are also cloned from master to patch-1 and patch-2 branch so please can you help me to delete those commits which are cloned from master?

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.

edited at
0

Comments

0 comments
Login to comment

Related

Pip install forked github-repo

npm install and build of forked github repo

Delete forked repo from GitHub

How do I delete a forked GitHub repo that's unavailable due to DCMA takedown?

GitHub: How to create pull request from forked repository to upstream repo only including some past commits

Github repo not showing latest commits

Combine commits and push to forked repo

Is it possible to clean up a remote repo's files with bad commits on GitHub?

Github - Delete a fork that was created from my repo

How to delete credential from commit in github repo?

How to load a feature branch from forked GitHub repo into my application?

Moving a forked Github repo: No settings tab

Github how to update the forked repo, entirely the same as newly forked

Is it possible to show a repo on Github's profile with all commits being a contributor?

Hard delete forked repo from GitHub

How do I make a PR from a forked repo, for only certain files, but all commits on them?

How do I change a github page to run from a forked repo?

Updating forked GitHub repo to match original's latest code and commits

Search a forked repo in GitHub

How to update forked github repo on heroku

change remote repo for a project forked from github on local machine (Rstudio)

How to pull a git repo from github with all unlinked commits

How to push your changes into a forked repo on Github?

Github Forked Repo Configuration

Possible to Recover From Deleting Forked Repo Deletion?

Setting up Github Pages from a forked repo

How can I use Github compare view to review changes relative to a repo that is duplicated, not forked, from the parent repo?

Migrate repo from Github to a specific Gitlab group

How can I use the GitHub API to find the original repo from a forked repo?