From e2139e1184b1b1368d6134ff71de15de424c2da2 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 1 Jun 2015 19:51:37 +0300 Subject: [PATCH] Add a section explaining 2 meanings of the word "branch" --- pep-git.txt | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/pep-git.txt b/pep-git.txt index df51311..6ed8bba 100644 --- a/pep-git.txt +++ b/pep-git.txt @@ -110,19 +110,30 @@ something like that:: $ git checkout -b v2 +Branches and branches +===================== + +Git terminology can be a bit misleading. Take, for example, the term +"branch". In git it has two meanings. A branch is a directed chain of +commits (possible with merges). And a branch is a label or a pointer +assigned to a line of commits. It is important to differentiate when +you talk about commits and when about their labels. Chains of commits +are unnamed and are usually only lengthening. Labels, on the other +hand, can be created, moved, renamed and deleted freely. + + Remote repository and remote branches ===================================== -Git terminology can be a bit misleading. Take, for example, terms -"remote repository" and "remote branches". A remote repository is +Another example of misleading terminology. A remote repository is really remote, you access it via network (well, a remote repository can be on your local disk, but it's still remote because it's not the current repo). -Remote branches, on the other hand, are pointers to commits in your -local repository. They are there for git to remember what branches and -commits have been pushed from and pulled to what remote repos (you can -pull from and push to many remotes). +Remote branches, on the other hand, are branches (pointers to commits) +in your local repository. They are there for git 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). To see the status of remote branches:: -- 2.39.2