@matheusbsbs / matheus-bagliano / commits / 11d5153344
Fork 0

user-manual: more explanation of push and pull usage

Recently a user on the mailing list complained that they'd read the manual but couldn't figure out how to keep a couple private repositories in sync. They'd tried using push, and were surprised by the effect. Add a little text in an attempt to make it clear that: - Pushing to a branch that is checked out will have odd results. - It's OK to synchronize just using pull if that's simpler. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>

J. Bruce Fields committed Jun 18, 2007 at 16:38 UTC 11d515334432e840d9699703e0634e9df58a4441
1 file changed +18 -1
Documentation/user-manual.txt
+18 -1
@@ -1772,7 +1772,7 @@ repository, but it works just as well in the other direction.
1772
1773 If you and the maintainer both have accounts on the same machine, then
1774 you can just pull changes from each other's repositories directly;
1775 -commands that accepts repository URLs as arguments will also accept a
1775 +commands that accept repository URLs as arguments will also accept a
1776 local directory name:
1777
1778 -------------------------------------------------
@@ -1780,6 +1780,15 @@ $ git clone /path/to/repository
1780 $ git pull /path/to/other/repository
1781 -------------------------------------------------
1782
1783 +or an ssh url:
1784 +
1785 +-------------------------------------------------
1786 +$ git clone ssh://yourhost/~you/repository
1787 +-------------------------------------------------
1788 +
1789 +For projects with few developers, or for synchronizing a few private
1790 +repositories, this may be all you need.
1791 +
1792 However, the more common way to do this is to maintain a separate public
1793 repository (usually on a different host) for others to pull changes
1794 from. This is usually more convenient, and allows you to cleanly
@@ -1802,6 +1811,8 @@ like this:
1811 | they push V
1812 their public repo <------------------- their repo
1813
1814 +We explain how to do this in the following sections.
1815 +
1816 [[setting-up-a-public-repository]]
1817 Setting up a public repository
1818 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1913,6 +1924,12 @@ proceeding the branch name by a plus sign:
1924 $ git push ssh://yourserver.com/~you/proj.git +master
1925 -------------------------------------------------
1926
1927 +Note that the target of a "push" is normally a
1928 +<<def_bare_repository,bare>> repository. You can also push to a
1929 +repository that has a checked-out working tree, but the working tree
1930 +will not be updated by the push. This may lead to unexpected results if
1931 +the branch you push to is the currently checked-out branch!
1932 +
1933 As with git-fetch, you may also set up configuration options to
1934 save typing; so, for example, after
1935