From d97d98eb25a34050380fa73f58752c2e2af5c207 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 29 Jun 2015 21:52:51 +0300 Subject: [PATCH] Use $-notation to denote meta-variables Distinguish meta-variables from literals like HEAD or README. --- pep-git.txt | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/pep-git.txt b/pep-git.txt index 081bd76..402dac8 100644 --- a/pep-git.txt +++ b/pep-git.txt @@ -62,7 +62,7 @@ many different languages. Download Russian translation from `GArik 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``. @@ -156,7 +156,7 @@ Remote-tracking branches are branches (pointers to commits) in your 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:: @@ -190,39 +190,39 @@ There is a major difference between :: - $ 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:: @@ -334,7 +334,7 @@ during fetch/pull. To fetch all tags (and commits they point to) run ``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:: @@ -407,7 +407,7 @@ file(s) to that one of a commit. Like this:: 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, @@ -473,7 +473,7 @@ branch:: and configure rebase for existing branches:: - $ git config branch.NAME.rebase true + $ git config branch.$NAME.rebase true For example:: -- 2.39.2