From: Steffen Prohaska Date: Thu, 25 Oct 2007 08:25:16 GMT Subject: Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued Message-ID: <4E5890F8-2184-4555-8FBE-6B92FE2590E9@zib.de> In-Reply-To: <47204C6D.3020900@op5.se> On Oct 25, 2007, at 9:57 AM, Andreas Ericsson wrote: > 50+ repositories, with stable, testing and maint branches. Some > repos have more > than that, so it amounts to roughly 200 branches. Each branch can > be modified by > anyone (we're a small company - everyone still works everywhere), > but all changes > should be done to the tip of the upstream branch. Especially for > maint this is a > bit of a problem, since we frequently have consultants out and > about, and they > sometimes find a bug that they commit locally to their own repo. > They're in a > hurry though, and have no connection to the mothership repo so they > can't git-pull > to get up to date. They aren't exactly developers, but savvy enough > to fix a few > simple bugs, but the concept of the locally-modifiable branches not > being updated > to their remote-tracking counterparts with each git-pull is just > incomprehensible > to them. To me, that suggests that we're doing something wrong. Johannes described a workflow using rebase. It would create a very clean history avoiding long "parallel roads" and it mimics what experience git users would probably do: Just work if you have no connection but cleanup your work by using rebase before pushing it. Johannes, and Peter, too, propose to delete local branches asap to avoid the third copy besides the copy on the server and the copy in remotes. They suggest that local branches should be absolutely reserved for local work. However, my feeling is that the current tools make it too hard to work the way described. Therefore it's hard to sell such a workflow to an unexperienced developer. For example checking out a remote branch for doing some local work, pushing this work, and cleaning up requires git checkout -b origin/ # work work ... git push origin git checkout git branch -D These are a lot of commands and some of them look quite redundant. Nearly every command contains . Why isn't is sufficient to tell the name of the branch I'm working on once. And '-D' looks even dangerous to me because it overrides all safety checks. This should not be needed in daily work. Here are some questions: Do you think a workflow using rebase is feasible for unexperienced git users? What would be needed to bring such a workflow down to a few, simple and reliable commands? I think the general question is what I described in a previous mail: You have a shared repository containing stable and topic branches. Provide a workflow that is as simple as possible for as many as possible developers. The average developer should need nothing more than equivalents of "cvs update", "cvs commit" for daily work if there are no conflicts. Note, there are no redundant branch names allowed in the commands. If a developer doesn't switch branches there's no need to tell the branch name. "git pull ; ... ; git push" is simple but it has the problem of reporting errors that average devs don't understand. Steffen