How to Disconnect a Cloned GitHub Repository and Make It Yours


Ever cloned a GitHub repo (maybe a boilerplate or a cool open-source project) but wanted to make it your own — with fresh Git history and no link to the original repo?
If yes, this guide will help you completely disconnect a cloned repository from its original source and start fresh with your own Git history and GitHub link.
🧹 Step 1: Remove the Existing Git History
Navigate to your cloned project folder in the terminal (git bash) and run:
rm -rf .git
💡 This removes all version control data, including commit history and the link to the original GitHub repo.
🔄 Step 2: Reinitialize Git
Now, start fresh:
git init
This sets up a new Git repository in your current project.
📦 Step 3: Stage Your Files
Add all files for tracking:
git add .
✅ Step 4: Make Your First Commit
git commit -m "Initial commit"
This is now the first commit of your independent project.
🔗 Step 5: (Optional) Connect to Your Own GitHub Repo
If you want to push to your own remote GitHub repository:
git remote add origin https://github.com/your-username/your-repo.git
git branch -M main
git push -u origin main
🎉 Done!
You’ve now disconnected the cloned repo and made it fully yours — clean history, no traces of the original source, and full control over your project’s versioning.
Happy coding!
~ Deepak Modi 🚀
Follow me for more dev tips, Git workflows, and full-stack content!
Subscribe to my newsletter
Read articles from Deepak Modi directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Deepak Modi
Deepak Modi
Hey! I'm Deepak, a Full-Stack Developer passionate about web development, DSA, and building innovative projects. I share my learnings through blogs and tutorials.