Answer the question
In order to leave comments, you need to log in
Working on a single file in Git using
There is a need to provide a person with one file / one folder / group of folders from the entire git repository for revision.
For some reason, you can't let $ git clone
the whole project be done.
Changes will be applied using $ git format-patch
and, accordingly, it should not contain changes to other files.
How can you transfer a folder to work with another user (without access to the repository at all) and then get a working and quite usable *.patch from him ?
Answer the question
In order to leave comments, you need to log in
If he needs a history of changes, make a filtered clone of your project, in which leave only the necessary (I have path-to-preserve) directories in the necessary branches (I have HEAD, i.e. the current one):
git filter-branch --tree-filter "find -not \( -path './path-to-preserve*' -o -path './.git' -o -path './.git/*' \) -delete" --prune-empty HEAD
Changes will be applied using $ git format-patch and should not contain changes to other files.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question