V
V
Vadim2021-07-09 16:38:28
git
Vadim, 2021-07-09 16:38:28

Is it possible to import one git repository into another with history preserved, ideally tags?

Hello everyone,

there is a repository, let's say project1 whose tree is something like this:

.
├── .git
└── folder1
└── folder2

I want to import the following project into it from github ( https://github.com/DefectDojo/django-DefectDojo ) , let's say in the defectdojo

folder so that in my .git turned out to be all the commits and ideally, the tags that are present in the repository on Github. For example superimposed on top of my history. Is this possible ... or nonsense))

All the best,
Vadim

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vadim, 2021-07-23
@Viji

cd my-project-with-git
git remote add remote-repo https://github.com/DefectDojo/django-DefectDojo.git
git fetch remote-repo --tags
git merge --allow-unrelated-histories remote-repo/master
git remote remove remote-repo

to check
git log
git tag

A
alternativshik, 2021-07-09
@alternativshik

https://git-scm.com/book/en/v2/Tools-Git-Under...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question