>>> "KK" == Konstantin Khomoutov <kos...@bswap.ru> writes:
First of all thanks very much for your time and patience to explain git. I appreciate it. Truth being told, most software is today developed in git not mercurial[3], facebook being the only exception, I can think of. So even with the hg-git plugin, knowing the basics of git seems a smart thing, besides, I am afraid if facebook switches to git, mercurial will fall in the abyss of obligation[1] > I surely would not want all those 190 branches live in "my own" space in the > repository - that'd just been too much of a cognitive burden which would > require me to invent certain workarounds. I see. I have to admit that the repositories I access and work with have around say 3, 4 branches. The only exception is GNU Emacs, that I usually access via mercurial and the hg-git converter, indeed this repository has a bewildering amount of branches that are converted to bookmarks. Now I think I still quite some gaps in my understanding of git, especially remote branches. Let me try to resume (and maybe draw some unhelpful analogies with hg). 1. Scenario: I connect with one remote repository: A remote branch allows me to obtain/control of a remote repository I am working with. Well I have git remote -v (hg path), to know which remote repository I am using. But, in hg, as you mentioned each commit has more meta information stored, besides the branch name[4], phases (a commit can be secret, so hg push will not push it, draft, can be pushed, public is already pushed or pulled), so remote branching is a way of obtaining information about the branch on the remote. Two questions - how do I know that I have pushed already a local commit? (Besides phases in hg, I can run hg out, to see what mercurial would push). - Say I I would have a couple of commits in say two local branches. How can I push them both? Or must I push for each branch? (in mercurial, the default is to push all branches, the -b option allows you to push only certain branches, I have the feeling that git is here, hm orthogonal.) 2. Scenario: I connect to various repositories (I have done that in the past for pushing to a main and to a sandbox repository, but I have never ever pulled from various repositories, Bob and Alice in your example and have no idea, what would happen if Bob and Alice have a main, feature and bug-fix branch in their respective repositories and I would run «hg pull github» and «hg pull bitbucket», I presume a big mess[2]. So in git that seems possible And I presume presume git branch -a would give me * main remotes/github/HEAD -> github/main remotes/github/bug-fix remotes/github/feature remotes/github/main remotes/bitbucket/HEAD -> bitbucket/main remotes/bitbucket/bug-fix remotes/bitbucket/feature remotes/bitbucket/main But, git checkout main Seems not a smart idea, it should be git branch feature-github github/feature # create local branch off a remote one git checkout feature-github # check local branch out git branch -u github/feature # make current branch track origin/feature And git branch feature-bitbucket bitbucket/feature # create local branch off a remote one git checkout feature-bitbucket # check local branch out git branch -u bitbucket/feature # make current branch track origin/feature Correct? regards Footnotes: [1] I am strongly reminded on the Xemacs/Emacs situation. I was a convinced Xemacs user, till, well the dev team basically gave up. [2] there is however an extension for remote branches, not sure it still words [3] although this is not relevant here, but git strongly reminds me on Plain TeX, flexible, but rather complicated, while mercurial reminds me on LaTeX, quite structured but most likely more rigid than git. [4] and these name branch are an advantage: you know precisely which commit belongs to which branch, but also a disadvantage, deleting or renaming a named branch is almost impossible -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/git-users/8735ahmito.fsf%40mat.ucm.es.
smime.p7s
Description: S/MIME cryptographic signature