On Oct 25, 2007, at 1:28 AM, Johannes Schindelin wrote:
Ok, there is not a fundamental difference between local branches
that automatically merge from remotes and local branches that
are purely local and _never_ merge anything automatically. Both
are only local branches.
But these two types of branches already behave differently when
I call "git pull". There is already some kind of "illusion"
that some local branches are more tightly connected to remote
branches than others.
"git pull" could help to make the illusion even better. The
illusion would be better if it was easier to keep the heads
of the local branches near to the heads of branches they
automatically merge from, as long as this is easily possible.
You're right. You can rebase your local changes on top of the new
shared remote head. And this is probably the best thing you can do
to get a clean history. Maybe it should be easier.
So, do I understand correctly, what you propose is:
- never merge but only rebase
- Due to lacking support for this in "git pull", never use
git pull when working with shared branches but instead _always_ use
"git fetch; git rebase origin/<branch_I'm_on>".
So you say that one of the first messages in "git for CVS users",
"The equivalent of cvs update is git pull origin" [1], is wrong.
I don't think I'm able to sell your proposed workflow with the current
documentation. But maybe I try if I'm absolutely convinced that it
is superior.
[1] http://www.kernel.org/pub/software/scm/git/docs/cvs-migration.html
Well if you have several local branches checked out that are
shared with others you run into the "git push" problem again ...
(see below at git push origin master).
Isn't this a bit dangerous? It forces to overwrite master
no matter what's on it. You don't see diffstats nor a fast
forward message that confirms what you're doing.
I'd like to see "git push" here. But to make this work without
error you'd need to _delete_ master after you pushed. Otherwise
it could happen that you later work on a different shared
branch and "git push" would complain about master. "git push"
would recommend to do a "git pull" and we're back where the
discussion started.
Or do you propose to delete master at this point? That is do
you propose to _never_ have remote branches checked out locally.
Except for a very short period when you do
git branch -m <shared_branch>
git push origin <shared_branch>
git checkout do-not-work-here
git branch -D <shared_branch>
But it already happens now. "git pull" sometimes merges a
remote branch (--track) and sometimes it reports an error that
is fails to do so (--no-track). It would only do more work
automatically in the future and report appropriate warnings
or errors if it runs into a problem.
Steffen
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html