Git: Clear local and remote repo and start over

Simply remove local .git directory, remove repo from server (if it is github - do Repo -> setiings -> remove).

Then create new repository on server, and locally do:

git init
git remote add origin [email protected]:user/project.git
git add .
git commit -m "Initial commit"
git push -u origin master

In my case I just wanted to refresh the local repo, I used Ruslan answer without the last two commands since I didn't need to do anything on the server side, and it worked perfectly! Of course I deleted the .git file locally as suggested without removing the remote directory before to execute the commands. Thanks!

Tags:

Git

Github