summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWin Treese <treese@acm.org>2010-02-05 19:48:11 -0500
committerAvery Pennarun <apenwarr@gmail.com>2010-02-05 21:02:52 -0500
commit37668a13edbc8bd8f8ac5ecbd5bf839a4171c09b (patch)
tree9a9d5ef6cccc9c43b02c91d664cf8090460fc071
parente2d0a4502f115ee63b8ff96661cfcc8aad075822 (diff)
downloadgit-37668a13edbc8bd8f8ac5ecbd5bf839a4171c09b.tar.gz
git-subtree.txt: add another example.
-rw-r--r--git-subtree.txt21
1 files changed, 19 insertions, 2 deletions
diff --git a/git-subtree.txt b/git-subtree.txt
index 9b2d48e334..2200aaeaf2 100644
--- a/git-subtree.txt
+++ b/git-subtree.txt
@@ -223,8 +223,8 @@ OPTIONS FOR split
subproject's history to be part of your project anyway.
-EXAMPLES
---------
+EXAMPLE 1
+---------
Let's use the repository for the git source code as an example.
First, get your own copy of the git.git repository:
@@ -284,6 +284,23 @@ the standard gitweb:
git log gitweb-latest..$(git subtree split --prefix=gitweb)
+EXAMPLE 2
+---------
+Suppose you have a source directory with many files and
+subdirectories, and you want to extract the lib directory to its own
+git project. Here's a short way to do it:
+
+First, make the new repository wherever you want:
+ <go to the new location>
+ git init --bare
+
+Back in your original directory:
+ git subtree split --prefix=lib --annotate="(split)" -b split
+
+Then push the new branch onto the new empty repository:
+ git push <new-repo> split:master
+
+
AUTHOR
------