How to get all commit releated to a folder and put it into new repo?

Thilina Dinith Fonseka

I have a git repo like

repo
/sub-project1
 /sub-folders and files
/sub-project2
 /sub-folders and files
/sub-project3
 /sub-folders and files

i want to remove

 /sub-project1
     /sub-folders and files

and create a new repo with all the git history related to that folder and files need to be also included.

main consideration is keep only the history related to that folder only and remove all other unwanted history

what is the best way to do it?

Thilina Dinith Fonseka

keep only the history of the desired folder. need to use following command

git filter-branch --tag-name-filter cat --prune-empty --subdirectory-filter <folder-name> -- --all

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to get last commit date inside a folder/directory in github repo?

From Dev

How to get all commit messages in a repo by one author?

From Dev

How to get all new code between commits and save them to folder

From Dev

How do I get the list of SHA values of all the files in a folder of my git repo using JGit library

From Dev

Get all the file Contents of a repo at Specific Commit using PyGitHub

From Dev

How can I put repo A under version control with commit history from cloned repo B?

From Dev

How to make a new GitHub repo of the local with same commit history?

From Dev

Git: How to get specified version of all files in a folder but not descendant folders given a commit ID

From Dev

How to copy a repo and filter out all commit descriptions

From Dev

Git / GitHub: How to get new local repo into empty remote repo

From Dev

How to get new files on a GitHub master repo

From Dev

How to get last commit time of every user in a git repo?

From Dev

How to pull remote repo only get its last commit in Git?

From Dev

How force NPM to get the last commit of package from repo with master?

From Dev

How to get all users in a Gitlab repo?

From Java

How to get contents of a folder and put into an ArrayList

From Dev

How to upload complete folder structure to Artifactory repo to a new folder and keep he folder name as it is?

From Dev

How to get all files in that folder

From Dev

How to undo commit, put into new branch then do a PR?

From Dev

Azure devops, how to deny access to all but one repo to a new team

From Dev

Cloning a Git repo into a new repo - without commit history

From Dev

How to get files from a commit, to a folder outside from my repository?

From Dev

how to put all files from folder and subfolders into an array

From Java

How to put all dependencies in separate folder for runnable jar?

From Dev

How to get all variables an put it on FPU stack?

From Dev

git: after changing repo, how to get the new differences?

From Dev

how to get new name for creating new folder, with new name to new folder

From Dev

Intellij Idea & SVN : How to add all new files on "Commit Directories"?

From Dev

How to move work on to a new branch and remove all commit history?

Related Related

  1. 1

    How to get last commit date inside a folder/directory in github repo?

  2. 2

    How to get all commit messages in a repo by one author?

  3. 3

    How to get all new code between commits and save them to folder

  4. 4

    How do I get the list of SHA values of all the files in a folder of my git repo using JGit library

  5. 5

    Get all the file Contents of a repo at Specific Commit using PyGitHub

  6. 6

    How can I put repo A under version control with commit history from cloned repo B?

  7. 7

    How to make a new GitHub repo of the local with same commit history?

  8. 8

    Git: How to get specified version of all files in a folder but not descendant folders given a commit ID

  9. 9

    How to copy a repo and filter out all commit descriptions

  10. 10

    Git / GitHub: How to get new local repo into empty remote repo

  11. 11

    How to get new files on a GitHub master repo

  12. 12

    How to get last commit time of every user in a git repo?

  13. 13

    How to pull remote repo only get its last commit in Git?

  14. 14

    How force NPM to get the last commit of package from repo with master?

  15. 15

    How to get all users in a Gitlab repo?

  16. 16

    How to get contents of a folder and put into an ArrayList

  17. 17

    How to upload complete folder structure to Artifactory repo to a new folder and keep he folder name as it is?

  18. 18

    How to get all files in that folder

  19. 19

    How to undo commit, put into new branch then do a PR?

  20. 20

    Azure devops, how to deny access to all but one repo to a new team

  21. 21

    Cloning a Git repo into a new repo - without commit history

  22. 22

    How to get files from a commit, to a folder outside from my repository?

  23. 23

    how to put all files from folder and subfolders into an array

  24. 24

    How to put all dependencies in separate folder for runnable jar?

  25. 25

    How to get all variables an put it on FPU stack?

  26. 26

    git: after changing repo, how to get the new differences?

  27. 27

    how to get new name for creating new folder, with new name to new folder

  28. 28

    Intellij Idea & SVN : How to add all new files on "Commit Directories"?

  29. 29

    How to move work on to a new branch and remove all commit history?

HotTag

Archive