git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Question about your git habits

From
Steven Walter <stevenrwalter@gmail.com>
Date
Feb 23, 2008, 01:28 UTC
Message-ID
<20080223012818.GA27745@dervierte>
In-Reply-To
<200802221837.37680.chase.venters@clientec.com>
On Fri, Feb 22, 2008 at 06:37:14PM -0600, Chase Venters wrote:
Show 11 quoted lines
> My question is: If you're working on multiple things at once, do you tend to 
> clone the entire repository repeatedly into a series of separate working 
> directories and do your work there, then pull that work (possibly comprising 
> a series of "temporary" commits) back into a separate local master 
> respository with --squash, either into "master" or into a branch containing 
> the new feature?
> 
> Or perhaps you create a temporary topical branch for each thing you are 
> working on, and commit arbitrary changes then checkout another branch when 
> you need to change gears, finally --squashing the intermediate commits when a 
> particular piece of work is done?

I favor the second approach: single working copy, multiple branches. My feeling is that wanting multiple workspaces is a holdover from using subversion. For me, it is much faster to "git commit -a -m wip" and then switch branches, than it would be to clone a whole new repository and manage the inter-repository relationships.

Don't get so down on the "intermediate commits," either. For one, whenever I switch back to a branch with a "wip" commit, I usually do a "git reset HEAD^" to remove it and get my working tree back where it was. There are also nifty tools like interactive rebase that assist you in rewriting history to produce a set of clean, atomic commits. It's not imperative to make your first draft perfection in git.

[...]
> Insight appreciated, and I apologize if I've failed to RTFM somewhere.

No worries, I remember being in your situation once. git opens up a host of opportunities with its flexibility, and getting started I was consistently stumped by which of the many paths I should choose.

-- 
-Steven Walter <stevenrwalter@gmail.com>
Freedom is the freedom to say that 2 + 2 = 4
B2F1 0ECC E605 7321 E818  7A65 FC81 9777 DC28 9E8F 
Previous: Tommy ThornNext: Jan Engelhardt
Message 3 of 29 in “Question about your git habits”
  1. Chase VentersFeb 23, 2008
  2. Tommy ThornFeb 23, 2008
  3. Steven WalterFeb 23, 2008
  4. Jan EngelhardtFeb 23, 2008
  5. Al ViroFeb 23, 2008
  6. Junio C HamanoFeb 23, 2008
  7. Al ViroFeb 23, 2008
  8. Junio C HamanoFeb 23, 2008
  9. Samuel TardieuFeb 23, 2008
  10. Daniel BarkalowFeb 23, 2008
  11. Jeff GarzikFeb 23, 2008
  12. Mike HommeyFeb 23, 2008
  13. Rene HermanFeb 23, 2008
  14. Willy TarreauFeb 23, 2008
  15. Sam RavnborgFeb 23, 2008
  16. Jakub NarebskiFeb 23, 2008
  17. J.C. PizarroFeb 23, 2008
  18. J.C. PizarroFeb 23, 2008
  19. Charles BaileyFeb 23, 2008
  20. J.C. PizarroFeb 23, 2008
  21. Charles BaileyFeb 23, 2008
  22. J.C. PizarroFeb 23, 2008
  23. Charles BaileyFeb 23, 2008
  24. J.C. PizarroFeb 23, 2008
  25. Charles BaileyFeb 23, 2008
  26. J.C. PizarroFeb 23, 2008
  27. Charles BaileyFeb 23, 2008
  28. J.C. PizarroFeb 23, 2008
  29. Mike HommeyFeb 23, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.