git - How to completely reset github repository in Pycharm? -


i'm trying delete , re-upload github repository. i'm using pycharm's github integration, , life of me can't figure out how make pycharm forget ever had github repo setup , start scratch.

i tried moving .git files location , clear pycharm's cache damned thing still remembers has github repository setup though doesn't exist on github anymore.

anyone knows how make pycharm forget ?

to unlink git repo github,

entering git remote -v list remotes configured.

origin  git@github.com:user/repo.git (fetch) origin  git@github.com:user/repo.git (push) gitlab  git@gitlab.com:/user/repo.git (fetch) gitlab  git@gitlab.com:/user/repo.git (push) 

the 1 github.com (https:// or git@) points remote github. (here origin)

to remove remote, can,

git remote remove origin  

or in older versions of git,

git remote rm origin  

to add new github repo remote, can

git remote add <name> <repo url> example. git remote add origin https://github.com/myusername/myproject.git 

to reset branch initial (or specific) commit,

in version control > log, scroll down initial (or specific) commit

pycharm version control

and click reset current branch here...

then select hard

hard reset git pycharm

and press reset. (this irreversible change)

to push changes in local repo remote repo (after resetting local desired commit), run push -f forcefully updates remote. make sure remote branch not protected push -f.

git push -f <remote> <branch>  example. git push -f origin master 

to delete .git stuff , startover, may run

sudo rm -rf .git/ 

at repo root (this delete .git directory, irreversible change) , run git init


Comments