Git: Moving a sub-directory to a new repo with history

preview_player
Показать описание
I needed to move a directory within a git repo to its own repo, but I wanted to preserve commit history. Using a sub directory filter in git can allow you to take a sub directory and make it a stand-alone git repository without losing commit history.

Рекомендации по теме
Комментарии
Автор

hi, great video!
but I have one question, when you used the git filter-branch command, you specified only 1 subdirectory. So let's say I want to do the same but with more than 1 subdirectory, how would you do it?
we want to do that in our project but that command did not work for more than 1.

ramirodeelias
Автор

following this video was really hard because normally we want to move one complete repository to another with its history. For me this didnt work

muhammadroshanmughees
Автор

Thanks for the video. How to sync the later changes from the source repo to the new repo?

sreerajTR
Автор

Hi Nice video.. Thanks for the efforts :)
i still have one doubt, in the main project the sub folder will be retained? or Just moved to new repo. ?

ManishRitsupport
Автор

Hi i want to create a duplicate of a directory in same repository with history, can you please guide how to achieve that?

roit
Автор

Hi jhenry,
Nice Video.
I have a question. If I have two repos, which should be in sync but they are not. One of repo is ahead of another with multiple branches and few commits. In that case, will the above mentioned way work fine ? Is there any ideal approach to do it ?
Assuming those two repos are in different github accounts.
Thanks in Advance !!

kittukrish
Автор

Hey, it's nice video
Using this command we can push the data of of folder from repo1 to repo2 is there any way to push that folder from repo1 to repo2 ?

ankitgoyal
Автор

I needed to add git pull --no-rebase origin main. After, override. Then, I need Add Readme, and commit, because I had conflicts with Readme... Then, finally, I could use git pull origin main

heliocloud
Автор

Good contents, but poor quality video. (blurred)

milind