Note that there are some explanatory texts on larger screens.

plurals
  1. POGit - How do I manage built files in different branches?
    text
    copied!<h3>Some Background</h3> <p>I have been using Git for a while now. The projects that I have been working on have not been too complicated in regards to branches/tags.</p> <p>I have decided to use git-svn at work. The SVN repository has many different branches. A lot of these branches are customer customized versions of the trunk.</p> <h3>The Problem</h3> <p>I often work on problems for different customers at different the same time. So I switch back and forth between branches all the time. The problem is that to test the products I have to rebuild the project each time I switch between branches. A build takes > 2 hours (from scratch):(</p> <p>I am assuming that there is a way to stash the build files in branch <code>customer_a</code> and then checkout <code>customer_b</code>, modify, build, test, commit. Then stash the build files and checkout <code>customer_a</code> again and pop the <code>customer_a</code> stash to get back to where I was.</p> <p>This only works if the build files are tracked (i.e. added or committed). I do not want to track the build files and I definitely do not want to check them in. Is there a way to stash (or do something similar) for non-tracked files? Or a common practice that people use to achieve the same type of thing?</p> <p>Note that the way our project gets built each library (of which there are thousands) gets builds the files local to the library folder i.e. they are not moved to a build folder at the root of the project. All the built files are spread out all over the place.</p> <h3>Update...</h3> <p>So based on some of the comments I think I need to give an example of my problem</p> <p>Here is my folder structure.</p> <pre><code>branch1/ src/ component1/ c1.c component2/ c2.c libsrc/ library1/ lib_1.c library2/ lib_2.c branch2/ src/ component1/ c1.c component2/ c2.c libsrc/ library1/ lib_1.c library2/ lib_2.c </code></pre> <p>So the problem is that <code>branch1</code> and <code>branch2</code> have the same ancestry but have diverged quite a bit. So if I check out <code>branch1</code> and build it I will get binaries (e.g. lib_1.o) that I link against in my <code>Makefile</code> to build the final component binaries.</p> <p>If I then checkout <code>branch2</code> make a change to <code>c1.c</code> and run make it tries to link to the binaries that were created by <code>branch1</code> (lib_1.o), since they still exist in the directories as built in the previous branch. To avoid this I have to do a clean build each time I switch branches (which takes hours).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload