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?


  • Why TFS with GIT is not working from command line?
  • Using Git to manage multiple forks from master branch for multiple clients
  • Git continues to push a .c9 folder despite it being in .gitignore
  • Is there any reason to not set 'git fetch' to always use the --prune option?
  • Does each branch have a separate stash?
  • Why do excluded files keep reappearing in my git sparse checkout?
  • “git add -A” command
  • Git Workflow for continuous development
  • Can you arc diff against a particular git branch?
  • How to make Git properly display UTF-8 encoded pathnames in the console window?
  • Add Module from GIT to Android Studio throws “buildToolsVersion is not specified” error
  • How to inject a commit between some two arbitrary commits in the past?
  • 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.