If you’ve accidentally committed a file or folder to your GitHub repo and don’t want it there, here’s a solution.
Git mishaps can happen to the best of us! Let’s assume you’ve committed “.????” folder (created by JetBrains IDEs)
To remove it from remote git repo
- Blacklist the “.????” folder by adding the “.????” folder to the .gitignore file in ?????? branch, then commit this change.
??? ?????? -? “?????? ???????” - In your branch, check this file out from master branch using
??? ???????? ?????? — .????????? - Remove the .idea folder from the git tree
??? ?? –?????? -? .???? - Commit this change to your branch and push it to GitHub
??? ?????? -? “?????? ???????”
??? ???? ?????? ??????
This will work to any remote repository, not just GitHub
Hi, How we can completely remove the file from GitHub which means remove the commits as well. For example, initially I committed a google-services.json file in GitHub and after that, I removed it from the above git cmd but in GitHub history able to see the history and view the files. So please help me with that.
Thanks.