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

Re: Looking for a way to set up Git correctly

From
EWEnrico Weigelt <weigelt@metux.de>
Date
Nov 11, 2010, 13:25 UTC
Message-ID
<20101111132502.GB23423@nibiru.local>
In-Reply-To
<BD94CB4FDD0C4462804E316F814A3CCA@denny>
* Dennis <denny@dennymagicsite.com> wrote:
Hi,
Show 5 quoted lines
> Now, this can be either really simple or really complicated.  My first 
> question is:  how do I set the repository up in the proper way where I 
> could work on all 3 projects separately, with additional possibility of 
> working on branch1 only and later committing my changes to branch2 and 
> branch3.  

As first step you could create 3 separate git repos in each directory and add everything to it (git init, git add -A, git commit). Then rename the branches properly (so instead of "master", they'll be called "branch1", "branch2", "branch2" or something like that). Create another (maybe bare) repo elsewhere, add it as remote to the three other ones and push their branches upwards. Now you have 4 repos, 3 for working on the individual branches and another for collecting them all (hub model). You could also choose to throw the first three away and only work in the last one.

> (Since projects are virtually identical, a fix in one branch 
> usually needs to be propagated to other branches)

In your case, cherry-pick might be the right for you. You could also do a little bit refactoring, making a 4th branch which the other 3 are then rebased onto. Then you could do your fixes in that branch and merged into or rebase the other 3 onto that one.

> My second question is that each branch has a huge folder with image data. 
> By huge I mean 1 to 4Gb, depending on the branch.  Since images are not 
> directly relevant to the development work, is there a way to not include 
> those folders in git?

see .gitignore file. nevertheless it might be useful to also have all the images in the repo for backup reasons.

BTW: if you're concerned about disk space, you could add the object dir
of the 4th (hub) repository to the 3 working repos (run git-gc in the
hub repo before that!). Next gc runs will remove the objects that are
already present in the hub. But beware! If you remove something in the
hub repo and run git-gc there, you could loose objects in the other repos!
(maybe it would be wise to add the 3 working repos as remotes in the
hub and always run an git remote update before git-gc in the hub).
cu
-- 
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: weigelt@metux.de
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------
Previous: Alex RiesenNext: Jonathan Nieder
Message 3 of 5 in “Looking for a way to set up Git correctly”
  1. DennisNov 11, 2010
  2. Alex RiesenNov 11, 2010
  3. Enrico WeigeltNov 11, 2010
  4. Jonathan NiederNov 11, 2010
  5. Jonathan NiederNov 11, 2010

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.