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

Re: question concerning branches

From
Jakub Narebski <jnareb@gmail.com>
Date
Aug 19, 2009, 20:01 UTC
Message-ID
<200908192201.36383.jnareb@gmail.com>
In-Reply-To
<4a8c51f5@wupperonline.de>
On Wed, 19 Aug 2009, Ingo Brueckl wrote:
Show 8 quoted lines
> Jakub Narebski <jnareb@gmail.com> writes:
> 
> > You finish old work (or stash it away), _then_ you begin new work.
> 
> Ok, this helps me a little bit to understand.
> 
> The branches aren't designed to split my work, but rather something to
> collect the different parts of my work.

Well, git is flexible enough that it can support also the workflow you tried to use.

Namely you can have many working directories tied to single repository 
(each of those checkouts should be of different branch).  You can use 
git-new-workdir script from contrib/worktree for that.  Then to switch 
branches you would just cd to appropriate directory (and keep unsaved 
changes and untracked files).  That said it is [much] less used 
workflow.
 
> But as software development often is something where you are coding on
> several issues at the same time which can't be committed immediately,
> it sounds that 'stash' is the developer's best friend.

Well, you can also commit and then clean up history with interactive rebase (or patch management interface such as StGit or Guilt). In distributed version control systems like Git the act of publishing changes is separate from the act of committing them (you should not rewrite published history, though).

-- 
Jakub Narebski
Poland
Previous: Jacob HelwigNext: Theodore Tso
Message 10 of 21 in “question concerning branches”
  1. Ingo BruecklAug 19, 2009
  2. Bruce StephensAug 19, 2009
  3. Avery PennarunAug 19, 2009
  4. Ingo BruecklAug 19, 2009
  5. Jakub NarebskiAug 19, 2009
  6. Ingo BruecklAug 19, 2009
  7. Avery PennarunAug 19, 2009
  8. Matthieu MoyAug 20, 2009
  9. Jacob HelwigAug 19, 2009
  10. Jakub NarebskiAug 19, 2009
  11. Theodore TsoAug 19, 2009
  12. Jakub NarebskiAug 19, 2009
  13. Theodore TsoAug 20, 2009
  14. Linus TorvaldsAug 19, 2009
  15. Randal L. SchwartzAug 20, 2009
  16. Ingo BruecklAug 20, 2009
  17. Johannes SixtAug 20, 2009
  18. Jakub NarebskiAug 20, 2009
  19. Junio C HamanoAug 19, 2009
  20. Ingo BruecklAug 19, 2009
  21. Andreas EricssonAug 20, 2009

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.