Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I restart a git project, and keep its history?

Tags:

git

Much like this question, but here I do care about forkers and history.

I restarted a project from scratch, and now I want to append it as a commit to an existing git repository. How can I achieve this?

like image 947
Jeroen Kransen Avatar asked Oct 31 '22 21:10

Jeroen Kransen


1 Answers

Delete the .git of the old repo, and in the new git repo:

cd /path/to/new/git/repo
git add --work-tree=/path/to/old/git/repo add -A .
like image 136
VonC Avatar answered Nov 15 '22 05:11

VonC