Some recent tests accidentally depended on very new versions of git.
[gitweb.git] / git-subtree.txt
index 649cc3098909d44e1a17902d7fd8f3e7b7ef0c30..2200aaeaf2868d7a413d2f96b86e929267533d2e 100644 (file)
@@ -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:
 
@@ -241,7 +241,7 @@ the upstream.  You could do this:
                0a8f4f0^.. --onto=1130ef3 --rejoin \
                --branch gitweb-latest
         $ gitk gitweb-latest
-        $ git push git@github.com:whatever/gitweb gitweb-latest:master
+        $ git push git@github.com:whatever/gitweb.git gitweb-latest:master
         
 (We use '0a8f4f0^..' because that means "all the changes from
 0a8f4f0 to the current version, including 0a8f4f0 itself.")
@@ -258,7 +258,7 @@ And you can merge changes back in from the upstream project just
 as easily:
 
        $ git subtree pull --prefix=gitweb \
-               git@github.com:whatever/gitweb gitweb-latest:master
+               git@github.com:whatever/gitweb.git master
 
 Or, using '--squash', you can actually rewind to an earlier
 version of gitweb:
@@ -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
 ------