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,040 points
1,045 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,320 points
146 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,320 points
95 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,320 points
154 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,320 points
104 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,320 points
104 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 in Git & GitHub by MD
• 95,320 points
129 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
1,336 views
+2 votes
1 answer