Offline documentation
---------------------
-Git has builtin help: run ``git help TOPIC``. For example, run
+Git has builtin help: run ``git help $TOPIC``. For example, run
``git help git`` or ``git help help``.
local repository. They are there for you to remember what branches and
commits have been pulled from and pushed to what remote repos (you can
pull from and push to many remotes). Remote-tracking branches live
-under ``remotes/REMOTE`` namespaces, e.g. ``remotes/origin/v2``.
+under ``remotes/$REMOTE`` namespaces, e.g. ``remotes/origin/v2``.
To see the status of remote-tracking branches run::
::
- $ git fetch REMOTE BRANCH
+ $ git fetch $REMOTE $BRANCH
and
::
- $ git fetch REMOTE BRANCH:BRANCH
+ $ git fetch $REMOTE $BRANCH:$BRANCH
-The first command fetches commits from the named BRANCH in the REMOTE
-repository that are not in your repository and leaves the id (the
-hash) of the head commit in file .git/FETCH_HEAD and
-updates remote-tracking branch.
+The first command fetches commits from the named $BRANCH in the
+$REMOTE repository that are not in your repository and leaves the id
+(the hash) of the head commit in file .git/FETCH_HEAD and updates
+remote-tracking branch.
-The second command fetches commits from the named BRANCH in the REMOTE
-repository that are not in your repository and updates both the local
-branch BRANCH and its upstream remote-tracking branch. But it refuses
-to update branches in case of non-fast-forward. And it refuses to
-update the current branch.
+The second command fetches commits from the named $BRANCH in the
+$REMOTE repository that are not in your repository and updates both
+the local branch $BRANCH and its upstream remote-tracking branch. But
+it refuses to update branches in case of non-fast-forward. And it
+refuses to update the current branch.
The first command is used internally by ``git pull``.
::
- $ git pull REMOTE BRANCH
+ $ git pull $REMOTE $BRANCH
is equivalent to
::
- $ git fetch REMOTE BRANCH
- $ git merge FETCH_HEAD # FETCH_HEAD is a literal here
+ $ git fetch $REMOTE $BRANCH
+ $ git merge FETCH_HEAD
-Certainly, BRANCH in that case should be your current branch. If you
+Certainly, $BRANCH in that case should be your current branch. If you
want to merge a different branch into your current branch first update
that non-current branch and then merge::
``git fetch --tags origin``. To fetch some specific tags fetch them
explicitly::
- $ git fetch origin tag TAG1 tag TAG2...
+ $ git fetch origin tag $TAG1 tag $TAG2...
For example::
git checkout HEAD~ README
The commands restores the contents of README file to the last but one
-commit in the current branch. By default a commit ID is simply HEAD;
+commit in the current branch. By default the commit ID is simply HEAD;
i.e. ``git checkout README`` restores README to the latest commit.
(Do not use ``git checkout`` to view a content of a file in a commit,
and configure rebase for existing branches::
- $ git config branch.NAME.rebase true
+ $ git config branch.$NAME.rebase true
For example::