9
I cloned a Github repository in my directory, but it came full of commits, ie versioned. I wanted to restart it as a repository, from scratch, as I do?
I’ve tried the remote: git reset
(didn’t work out).
What I want is the contrary to the command git init
you want to clone a repository but you want it to come without commits?
– athosbr99
@athosbr99 I think Bruno wants to erase the history of the commits... honestly, I can’t imagine a situation where he wanted to do that. I always think it’s important to preserve the history.
– dcastro
I imagined doing this so that I could commit to Github as a newly initialized repository. Without the commits that came when I cloned someone else’s repository. There is @dcastro a better way to do this, or this is not good practice?
– Bruno Alexandre
Is the repository you cloned also hosted on Github? If so, it’s best to "Fork" to get a copy of the repository
– dcastro
Either way, I think you should always keep track. You can always push the clone to github with the old history.
– dcastro
I know a former college professor who was asked to help find a bug in a company project. A task that should have lasted a day or two, it took weeks, because someone decided to erase the whole history and there was no way to find out when the bug was entered.
– dcastro