gawkworkflow: Local Branches
1
1 2.3 Local Branches
1 ==================
1
1 Let's talk about local branches in more detail. (The terminology used
1 here is my own, not official Git jargon.) There are two kinds of local
1 branches:
1
1 "Tracking Branches"
1 Tracking branches track branches from the upstream repository. You
1 first create a tracking branch simply by checking out a branch from
1 the upstream. You use the branch name without the leading
1 'origin/' prefix. For example, 'git checkout gawk-4.1-stable'.
1
1 You can then work on this branch, making commitments to it as you
1 wish. Once things are ready to move upstream, you simply use 'git
1 push', and your changes will be pushed up to the main repo.(1)
1
1 You should *never* checkout a branch using the 'origin/' prefix.
1 Things will get very confused. Always work on local tracking
1 branches.
1
1 "Purely Local Branches"
1 A "purely local branch" exists only on your system. You may be
1 developing some large new feature, or fixing a very difficult bug,
1 or have a change for which paperwork has not yet been completed.
1
1 In such a case, you would keep your changes on a local branch, and
1 periodically synchronize it with 'master' (or whichever upstream
1 branch you started from).
1
1 This may seem somewhat abstract so far. We demonstrate with commands
1 and branches in ⇒Development without commit access, later in this
1 Info file.
1
1 Let's say you have checked out a copy of 'gawk-4.1-stable' and have
1 created a purely local branch named 'better-random'. Then our picture
1 now looks like ⇒Figure 2.3 your-repo-2, where the 'T' column
1 indicates a tracking branch.
1
1 +===+======================++=============================+
1 | T | Local Branches || Remote Branches |
1 +===+======================++=============================+
1 | X | master || origin/master |
1 +---+----------------------++-----------------------------+
1 | X | gawk-4.1-stable || origin/gawk-4.1-stable |
1 +---+----------------------++-----------------------------+
1 | | || origin/gawk-4.0-stable |
1 +---+----------------------++-----------------------------+
1 | | || origin/feature/fix-comments |
1 +---+----------------------++-----------------------------+
1 | | || ... |
1 +---+----------------------++-----------------------------+
1 | | better-random || |
1 +---+----------------------++-----------------------------+
1
1 Figure 2.3: Your Local 'gawk' Repository With a Purely Local Branch
1
1 ---------- Footnotes ----------
1
1 (1) Assuming you have permission to do so, of course.
1