How to disable (stop, remove, delete) git versioning of a repository

I cloned a GitHub repository in my directory, but it came full of commits, i.e. versioned. Wanted to restart it as a repository, from scratch, how do I?

Already tried the Command: git reset (did not work).

What I want is the opposite of the command git init

Author: Fernando Silveira, 2014-12-04

5 answers

Delete The Hidden folder .git inside the repository and run git init to start a new history.

 15
Author: dcastro, 2019-11-15 12:46:37

I managed with the following command on linux/ubuntu

rm -rf .git
 4
Author: Bruno Alexandre, 2014-12-05 13:11:22

As already answered by dcastro, just remove the folder .git that is inside the repository. So you can start over.

If for some reason you do not want to download the history of a repository when cloning it, use the --depth flag as in the example:

git clone https://github.com/curl/curl.git --depth=1
 1
Author: Erick Mendonça, 2016-08-01 14:00:32

G git rm file.txt

Changes to be submitted:

    deleted:    file.txt

G git commit-m " file.txt removed "

Https://medium.com/@andgomes/git-removendo-arquivos-de-um-reposit%C3%B3rio-7eed699a035f

 -1
Author: Ana Paula Anjos, 2019-11-15 03:50:38

With this command you can remove all the Tracheoed files.

rm -rf .git 

On linux, there is no point in removing the .Git folder that history returns.

 -2
Author: Mauricio Henrique, 2019-12-13 12:17:55