This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorials:git-move-pkg [2011/05/23 13:24] – pangerci | tutorials:git-move-pkg [2011/05/23 13:26] (current) – pangerci | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | The following sequence of steps teaches you how to move ROS packages from one (e.g. private) into another (e.g. public) repository while preserving the history at the same time. | ||
+ | * git clone new-repos-uri | ||
+ | * cd into new repos directory | ||
+ | * git remote add src old-repos-uri | ||
+ | * git fetch src | ||
+ | * git checkout src/master -b tmp-branch | ||
+ | * Do the magic filter command: | ||
+ | < | ||
+ | git filter-branch -f --tree-filter 'find . -maxdepth 1 -not -name . -a -not -name cool_package_name -a -not -name .git -exec rm -r {} \;' | ||
+ | </ | ||
+ | //The above command basically removes in every revision everything but the directories .git and cool_package_name.// | ||
+ | * git checkout master | ||
+ | * git merge tmp-branch | ||
+ | * git filter-branch --prune-empty -f | ||
+ | * git push |