Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting a cloned git repo into a forked one

I cloned someones github repo, checked out a new branch to isolate changes I was about to make. having modified the code base significantly I realized I should have instead forked the repo and then send out pull request with my changes.

How can I swiftly recover from that as if I were forking the repo from the start?

like image 259
user776686 Avatar asked Oct 26 '25 14:10

user776686


1 Answers

Fork the repo. This will create a clone on GitHub at your user account.

Change the URL of origin to your fork's URL (instead of the original repo):

git remote set-url origin <fork_url>

Push to origin (your fork), visit your fork's page on GitHub, and there should be a link to compare branches and create Pull Request.

like image 152
janos Avatar answered Oct 29 '25 03:10

janos



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!