On Sat, Apr 21, 2012 at 3:26 AM, Ralph Versteegen <[email protected]> wrote: > > I found this pretty confusing too, and I'm still not entirely > comfortable working with remotes. > > But I'll point out (though this is getting into advanced territory) > that there are usually *three* copies of a remote branch: the actual > branch on the remote machine (don't be fooled, unlike in svn you can > not directly access these, first you have to copy them to your > machine), your copy of the remote branch (named remotename/branchname > e.g. origin/master), and your personal copy of the branch (e.g. > 'master'), (called a 'remote tracking' branch) which is the one you > modify.
Is this really true? The model I learnt includes: * the actual branch on the remote machine (eg. master; which as you mentioned, cannot be modified; you can only directly modify local branches) * one or more 'aliases' that map local branch names to remote+branch combinations (these are modifiable, but only on the alias level or via git push/pull, not on the individual file level). * local branch (this is called a 'remote tracking' branch if it originates from one of the 'aliases' (aka 'remotes')) > > But any of these three copies might not exist, and you can actually > modify 'origin/master' -- I've done that by accident a few times. This is true. I'm guessing that you accidentally created a *local branch* named 'origin/master' (not a remote; a remote is the usual situation in which you'd see an identifier like 'origin/master'). The reason you can do that is that '/' is a character which is allowed in branch names, TL;DR : The branch you really modified, is it reaaaally the remote branch 'origin/master', or is it a local branch? Cause AFAICS the former is directly and intentionally prevented by Git, following the 'all changes are local unless explicitly pushed/pulled' principle. _______________________________________________ Ohrrpgce mailing list [email protected] http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
