diff options
author | Junio C Hamano <junkio@cox.net> | 2006-01-22 13:32:45 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-01-22 22:05:54 -0800 |
commit | 76b927f19f207b3f71b1c675bd75680aaedcb001 (patch) | |
tree | 7603fb5b432367c27c1a98caaada93eb7bfae8ba /Documentation/core-tutorial.txt | |
parent | New tutorial (diff) | |
download | tgif-76b927f19f207b3f71b1c675bd75680aaedcb001.tar.xz |
Recommend to remove unused `origin` in a shared repository.
It is a common mistake to leave an unsed `origin` branch behind
if a shared public repository was created by first cloning from
somewhere else. Subsequent `git push` into it with the default
"push all the matching ref" would push the `origin` branch from
the developer repository uselessly.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'Documentation/core-tutorial.txt')
-rw-r--r-- | Documentation/core-tutorial.txt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Documentation/core-tutorial.txt b/Documentation/core-tutorial.txt index b8fa299920..35579cc5b0 100644 --- a/Documentation/core-tutorial.txt +++ b/Documentation/core-tutorial.txt @@ -1667,6 +1667,26 @@ complain, telling you that the remote `master` head does not fast forward. You need to pull and merge those other changes back before you push your work when it happens. +The `git push` command without any explicit refspec parameter +pushes the refs that exist both in the local repository and the +remote repository. So the last `push` can be done with either +one of these: +------------ +$ git push origin +$ git push repo.shared.xz:/pub/scm/project.git/ +------------ +as long as the shared repository does not have any branches +other than `master`. +[NOTE] +============ +If you created your shared repository by cloning from somewhere +else, you may have the `origin` branch. Your developers +typically do not use that branch; remove it. Otherwise, that +would be pushed back by the `git push origin` because your +developers' repository would surely have `origin` branch to keep +track of the shared repository, and would be counted as "exist +on both ends". +============ Advanced Shared Repository Management ------------------------------------- |