aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Sabath <dsabath@whitepages.com>2010-02-08 20:31:51 -0500
committerAvery Pennarun <apenwarr@gmail.com>2010-02-08 20:31:51 -0500
commitc6ca48d4dc5b93a7576d2afa66b057f8c8a20718 (patch)
treef0451e7793146774a2abadb648969f04fc0896c4
parent6fe986307d983704d3c6b3540f91fa301ff48549 (diff)
downloadgit-c6ca48d4dc5b93a7576d2afa66b057f8c8a20718.tar.gz
git-c6ca48d4dc5b93a7576d2afa66b057f8c8a20718.tar.xz
docs: add simple 'add' case to clarify setup.
This patch adds a simple use case for adding a library to an existing repository. Signed-off-by: Dan Sabath <dsabath@whitepages.com>
-rw-r--r--git-subtree.txt28
1 files changed, 26 insertions, 2 deletions
diff --git a/git-subtree.txt b/git-subtree.txt
index 2200aaeaf..cde5a7e73 100644
--- a/git-subtree.txt
+++ b/git-subtree.txt
@@ -225,7 +225,31 @@ OPTIONS FOR split
EXAMPLE 1
---------
-Let's use the repository for the git source code as an example.
+Let's assume that you have a local repository that you would like
+to add an external vendor library to. In this case we will add the
+git-subtree repository as a subdirectory of your already existing
+git-extensions repository in ~/git-extensions/.
+
+First we need to fetch the remote objects
+ $ cd ~/git-extensions
+ $ git fetch git://github.com/apenwarr/git-subtree.git master
+
+'master' needs to be a valid remote ref and can be a different branch
+name
+
+Now we add the vendor library with
+ $ git subtree add --prefix=git-subtree --squash FETCH_HEAD
+
+You can omit the --squash flag, but doing so will increase the number
+of commits that are incldued in your local repository.
+
+We now have ~/git-extensions/git-subtree directory with the git-subtree
+subdirectory containing code from the master branch of
+git://github.com/apenwarr/git-subtree.git
+
+EXAMPLE 2
+---------
+Let's use the repository for the git source code as an example.
First, get your own copy of the git.git repository:
$ git clone git://git.kernel.org/pub/scm/git/git.git test-git
@@ -284,7 +308,7 @@ the standard gitweb:
git log gitweb-latest..$(git subtree split --prefix=gitweb)
-EXAMPLE 2
+EXAMPLE 3
---------
Suppose you have a source directory with many files and
subdirectories, and you want to extract the lib directory to its own