Import git repository to an empty branch

Let's say a project was developed in one repo, and a project website was developed in another.

Is there a way to import a repository of a site with a full history into an empty branch in the project repo?

+3
source share
2 answers
git remote add rweb git: // whereever
git fetch rweb

And voila, you have this in one repository. You might also want to create a branch from it to make it accessible and movable:

git branch website rweb / master
git push origin website

Starting with empty branches and dumping the website tree, there will instead be a flaw in losing the whole story.

+8
source

I assume this will be the case for git submodules

0
source

Source: https://habr.com/ru/post/1777567/


All Articles