Git export import commits history

0 votes
we have one big git repo, which includes 3 folders for different projects:

Existing repo consists of - .net_newrepo, java_newrepo, android_newrepo

New project should contain history only about particular project. .net about .net, and not about ios and android etc.
Jul 12, 2018 in Git & GitHub by Nilesh
• 7,060 points
2,285 views

1 answer to this question.

0 votes

This should work

$ cd dotnet_newrepo
$ git filter-branch --subdirectory-filter dotnet_is_dir -- --all
$ cd ..
$ cd java_newrepo
$ git filter-branch --subdirectory-filter java_is_dir -- --all
$ cd ..
$ cd android_newrepo
$ git filter-branch --subdirectory-filter android_is_dir -- --all
$ cd ..
answered Jul 12, 2018 by Kalgi
• 2,680 points

edited Jul 12, 2018 by Kalgi

Related Questions In Git & GitHub

0 votes
1 answer

How to view git logs of one user's commits?

Hi@akhtar, You can use the git log command ...READ MORE

answered Sep 4, 2020 in Git & GitHub by MD
• 95,460 points
2,685 views
0 votes
1 answer

How to undo the most recent local commits in Git?

Hi@akhtar, There is one way available to undo ...READ MORE

answered Dec 21, 2020 in Git & GitHub by MD
• 95,460 points
633 views
0 votes
1 answer

How to move the most recent commits to a new branch with Git?

Hi@akhtar, If you want to move your commits ...READ MORE

answered Dec 22, 2020 in Git & GitHub by MD
• 95,460 points
835 views
+1 vote
1 answer

How to view the change history of a file using Git versioning?

Hi@akhtar, You can use gitk for this task. ...READ MORE

answered Dec 22, 2020 in Git & GitHub by MD
• 95,460 points
1,061 views
0 votes
1 answer

How to make Git use the editor of our own choice for commits?

Hi@akhtar, You can set the editor name in ...READ MORE

answered Dec 23, 2020 in Git & GitHub by MD
• 95,460 points
576 views
0 votes
1 answer

How to undo pushed commits in Git?

Hi@akhtar, You can revert individual commits with: git revert ...READ MORE

answered Jan 4, 2021 in Git & GitHub by MD
• 95,460 points
705 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,062 views
+2 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP