1CG-BRANCH-ADD(1) CG-BRANCH-ADD(1)
2
3
4
6 cg-branch-add - add new remote branch
7
9 cg-branch-add BRANCH_NAME LOCATION
10
11
13 Takes the desired branch name and source location as parameters.
14
15 This command lets you add to the list of remote branches. Those are
16 branches in your local repository which correspond to some branches in
17 other repositories.
18
19 After you add a remote branch, you can cg-fetch(1) from it to get the
20 latest changes on the branch, as they appeared in the remote
21 repository.
22
23 Terminology note: This command concerns remote branches, not the local
24 ones (those managed by cg-switch(1)).
25
26 The possible source location specifiers are:
27
28
29 1. Local path - note that fetching will hardlink the objects if
30 possible.
31
32 2. rsync - rsync://host/path THE rsync REPOSITORY ACCESS METHOD IS
33 DEPRECATED AND WILL BE REMOVED IN THE FUTURE! The problem is that it
34 will download _all_ data from the remote repository, including
35 objects which do not belong to the one particular branch you want to
36 fetch.
37
38 3. HTTP - http://host/path
39
40 4. HTTPS - https://host/path
41
42 5. FTP - ftp://host/path
43
44 6. SSH - git+ssh://host/path or host:path (the latter can change); note
45 that the path must be absolute in the first case.
46
47 7. git daemon - git://host/path The URL can have a fragment part, which
48 identifies a branch inside of the remote repository (in the form
49 "repoURL#branchname"). Otherwise, Cogito defaults to whatever branch
50 the repository's HEAD points to at the time of each fetch.
51
52
54 -h, --help
55 Print usage summary.
56
57 --long-help
58 Print user manual. The same as found in cg-branch-add(1).
59
61 $GIT_DIR/branches/BRANCH_NAME
62 Contains the source location of the remote branch.
63
64 $GIT_DIR/refs/heads/BRANCH_NAME
65 Contains pointer to the latest commit in a branch. It can be
66 more conveniently retrieved using cg-object-id BRANCH_NAME.
67
69 Let's say you have a repository at git+ssh://host/path/repo.git and you
70 want to fetch its testing branch to your local repository. In that case
71 you can do
72
73
74 $ cg-branch-add repo-testing 'git+ssh://host/path/repo.git#testing'
75 and refer to it as repo-testing anytime later:
76
77
78 $ cg-fetch repo-testing
79 For example you can check the changes in the repo-testing branch
80 compared to your current branch:
81
82
83 $ cg-diff -r repo-testing
84
86 Copyright © Petr Baudis, 2005
87
88
90 cg-branch-add is part of cogito(7), a toolkit for managing git(7)
91 trees.
92
93
94
95
96 12/11/2006 CG-BRANCH-ADD(1)