![]() Git repositories aren't limited to having a single URL to push/pull from – it is very common to have two when working with forks, and to directly fetch commits and branches from both. (Neither the "origin/" branches nor "upstream/" ones are actually local to the repo that GH Desktop is showing they're only locally cached copies of remote branches.) The cloned repository that you have on your desktop is fully separate from the fork that you have on GitHub – it has its own branches and everything. You're not only working on a fork you're working on a fork of the fork. How is it possible that I could switch to a branch on the upstream repo if I'm working on a fork? Diverging is expected, so the branches downloaded from a remote repository are always namespaced with "reponame/", while Hg's docs imply that a diverged bookmark is supposed to be dealt with quickly.) Though it seems that Git branches aren't kept as strictly in sync with the remote repository as Hg bookmarks are. And similarly, when you create a new local branch off "master", it's just creating a second bookmark that points to the same commit as "master". branch) is updated to point to them, so now both the local and remote bookmarks independently point to the same commit. (In fact, that's what happens when you push to GitHub – first the commits are uploaded, and then the remote repository's "main" or "master" bookmark (i.e. They're not immutably attached to commits but act as flexible pointers to some commit ID (see Mercurial's Bookmarks docs), so it is entirely possible for several repositories to have their own bookmarks pointing to the same commit. Git branches work like Mercurial's bookmarks. (but bear in mind I come from a Mercurial background so maybe I'm not fully understanding Git's branches - I think they exist outside the version control somehow?). ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |