Git Clone, Delete the GitHub Repo, create new repo–>still have commit history?

I’m a newbie to git, and was hoping to delete a particular GitHub repository (from public view purposes). However, I’d like to keep a “copy” on my local computer with all its previous commits. If I git clone the repo, delete the repo on GitHub, then create a new repo, and finally push the local cloned project to the new repo, will the new repo have my commit history? Is this because the commit history is “stored” in my local project?


  • What is Repo and Why does Google use it?
  • Would you migrate from cvs to svn or directly to git or hg?
  • “git --bare init” does not produce just a .git directory
  • How is mirror cloning in git so fast and small?
  • gitignore all files of extension in directory
  • SourceTree password after opening Bitbucket account with gmail
  • git-gui: Moving keyboard focus to “changed files”
  • Git: ignore files but not sub-directories in a directory
  • why does Git send whole repository each time push origin master
  • Beyond Compare 2 as Git Mergetool
  • Tracking history of a branch
  • Starting with Git: How can I set the directory to work in?
  • 2 Solutions collect form web for “Git Clone, Delete the GitHub Repo, create new repo–>still have commit history?”

    Yes, it will still have the history, as the entire repo (which includes the history) is pushed.

    If you want to create a version of the repo without the history, do the following:

    1. Make a copy of your directory to, say, newdir
    2. Delete newdir/.git
    3. In newdir, type git init .
    4. Still in newdir, type git add .

    Now newdir will contain a repo with just a single commit, which contains the latest from your repository, and you can push that.

    Yes, the new repo will still have your commit history. When you “clone” a repo, you are cloning ALL aspects of it, which include commit history.

    Git Baby is a git and github fan, let's start git clone.