How to fully delete a git repository created with init?

前端 未结 13 1967
再見小時候
再見小時候 2020-11-22 16:42

I created a git repository with git init. I\'d like to delete it entirely and init a new one.

13条回答
  •  情书的邮戳
    2020-11-22 17:20

    You can create an alias for it. I am using ZSH shell with Oh-my-Zsh and here is an handy alias:

    # delete and re-init git
    # usage: just type 'gdelinit' in a local repository
    alias gdelinit="trash .git && git init"
    

    I am using Trash to trash the .git folder since using rm is really dangerous:

    trash .git
    

    Then I am re-initializing the git repo:

    git init
    

提交回复
热议问题