Paolo Ciarrocchi wrote: > On 10/29/06, Jakub Narebski <jnareb@xxxxxxxxx> wrote: >> Paolo Ciarrocchi wrote: >> >>> I went trough the docs I found on the web but I still don't fully >>> understand why if I clone a remote repository my local copy has two >>> branches, origin (that is always a exact copy of the remote >>> repository) and master which is... what? The branch supposed to be >>> used for local development? >>> >>> I'm used to just checkout to a new branch, do my own development and >>> then diff against origin so I'm missing why I see the master branch. [...] >> If you don't do your development on 'master', but use other branches, >> the 'master'/'origin' is unnecessary; you could fetch 'master' into >> 'master'... >> >> By the way, if you clone with --use-separate-remote you would get >> separate namespace for tracking branches; additionally they would >> be treated read-only (can't commit to). > > There is still one thing I don't understand, if I pull the git or > kernel repository all the local branches are updated according to the > remote branches, right? If I'm hacking on master what will happen to > my local changes? With the default setup (git clone without --use-separate-remote), then all local branches are updated according to remote branches... with the exception of remote 'master' branch which updates local 'origin' branch. pull = fetch + merge, so if you pull when you are on your local 'master' branch (and 'master' branch is first in the .git/remotes/origin file I think) you would fetch remote 'master' into local 'origin' and merge what you have in 'origin' into your 'master' (or merge remote 'master' into your local 'master' if you want to think like that). If you have uncommitted changes git would probably refuse the merge. If you made changes to one of the tracking branches (e.g. 'next' or 'origin'), git would refuse to fetch into this branch (unless forced). HTH -- Jakub Narebski Poland - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html