I'm trying to completely delete and re-upload my GitHub repository. I'm using Pycharm's GitHub integration, and for the life of me I can't figure out how to make Pycharm forget I ever had GitHub repo setup and just start from scratch.
I even tried moving the .git files to another location and clear Pycharm's cache but the damned thing still remembers it has a Github repository setup even though it doesn't actually exist on GitHub anymore.
Anyone knows how to make Pycharm forget ?
entering git remote -v
will list the remotes configured.
origin [email protected]:user/repo.git (fetch)
origin [email protected]:user/repo.git (push)
gitlab [email protected]:/user/repo.git (fetch)
gitlab [email protected]:/user/repo.git (push)
the one with github.com (https://
or git@
) points to the remote to GitHub. (here origin
)
To remove a remote, you can,
git remote remove origin
or in older versions of git,
git remote rm origin
To add a new github repo as the remote, you can
git remote add <name> <repo url>
example. git remote add origin https://github.com/myusername/myproject.git
in the version control
> log
, scroll down to the initial (or any specific) commit
and click Reset Current Branch to Here...
then select hard
and press reset. (this is an irreversible change)
to push the changes in the local repo to the remote repo (after resetting to local to desired commit), run push with -f
which forcefully updates the remote. make sure the remote branch is not protected to push -f
.
git push -f <remote> <branch>
example. git push -f origin master
.git
stuff and startover, you may runsudo rm -rf .git/
at the repo root (this will delete the .git directory, irreversible change) and then run git init
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With