Reputation: 783
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?
Thanks!
Upvotes: 2
Views: 65
Reputation: 19025
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:
git init .
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.
Upvotes: 4
Reputation: 3670
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.
Upvotes: 1