Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UNDO Reinitialized existing Git repository Made a mistake

Tags:

git

github

I had apparently made a mistake in some code in the original git push from the command line. After about 5 retrys I need help. The code in the program is fixed but when I do

git init

It says

Reinitialized existing Git repository in 

What my question is. How do you wipe the memory of the git so that you can redo everything over again and upload it as if the code was there for the first time?

like image 312
studentofmsu Avatar asked Jun 13 '18 05:06

studentofmsu


People also ask

What happens when you reinitialize git?

The git init command creates a new Git repository. It can be used to convert an existing, unversioned project to a Git repository or initialize a new, empty repository. Most other Git commands are not available outside of an initialized repository, so this is usually the first command you'll run in a new project.

What happens if you run git init twice?

What happens if I run git init twice? Running git init in an existing repository is safe. It will not overwrite things that are already there. The primary reason for rerunning git init is to pick up newly added templates.


1 Answers

This sovled the issue. If you had a previous mistake in git and want to delete it then do

rm -rf .git

Then do

git init

To start over

like image 158
studentofmsu Avatar answered Oct 24 '22 12:10

studentofmsu