summaryrefslogtreecommitdiffstats
path: root/software
diff options
context:
space:
mode:
authorbryan newbold <bnewbold@twinleaf.com>2014-11-05 23:21:58 -0800
committerbryan newbold <bnewbold@twinleaf.com>2014-11-05 23:24:29 -0800
commit8968718cdd7c289e63e25c0ef964aeadd169b384 (patch)
treeb892c3f290649b743a0884bbff47803bcd15feda /software
parent9f92a40429794704ea33fb48d4cd8e894eeadfe0 (diff)
downloadknowledge-8968718cdd7c289e63e25c0ef964aeadd169b384.tar.gz
knowledge-8968718cdd7c289e63e25c0ef964aeadd169b384.zip
git: copying files btwn repos w/ history
Diffstat (limited to 'software')
-rw-r--r--software/git.page18
1 files changed, 18 insertions, 0 deletions
diff --git a/software/git.page b/software/git.page
index 3f4e3ef..ffad5ed 100644
--- a/software/git.page
+++ b/software/git.page
@@ -18,3 +18,21 @@ copy ``hooks/post-update.sample`` to ``hooks/post-update``.
To add links from gitweb, add to the ``@git_base_url_list`` list in the
configuration file.
+
+Copying Files Between Repositories with History
+------------------------------------------------
+
+Create a branch with only python files (slow; ignore the very verbose "won't
+delete directory" output):
+
+ git checkout -b filtered-commits
+ git filter-branch -f --prune-empty --tree-filter 'find . -not -iname "*.py" -exec rm {} \;' filtered-commits
+
+In the receiving repo:
+
+ git pull path/to/source/repo
+
+See also:
+
+http://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/
+http://superuser.com/questions/164362/git-keep-changelog-for-file-when-moving-to-a-different-repository