I am trying to copy all the files in a public git repository, let's call it repo_A, into a completely new private git repository, let's call it repo_B.
As far as I know, git init --template
will not fit that need.
I currently run this set of terminal commands:
git clone repo_A_clone_link
git clone repo_B_clone_link
cp -a ./repo_B/.git/. ./repo_A/.git/
cp -a ./repo_A/. ./repo_B/
cd ./repo_B
git push
The push is successful, and I see all the files from repo_A in repo_B's master branch.
The problem is for some reason, I still see repo_A's commit history in repo_B.
I tried to read about the subject and investigate, but according to this question it seems that the fact repo_B's .git
directory did not change should mean its history won't change either.
Also went through this question, that one and several others.
What am I missing here? How can I prevent the history from being copied as well?
I saw that using --depth 1
might solve it, but I would love to understand what I'm missing from the .git
directory perspective.
Thanks!