2009/11/11 Daniele Segato <daniele.bilug@xxxxxxxxx>: > I had a situation I don't know how to manage with Git. > > The project has a lot of setting that are really binded to the user > and should not go pushed in a remote repository (example: database > connections parameters / filesystem paths) > We have a .template file for those settings but the actual settings > are really binded to the user environment. > I added those files to the .gitignore but now I can't keep an history > of them and I can't use different version of them in different > branches. > > I tell you what's the real situation but I will simplify things a > little, suppose I only have two branches: master and experiments. > > I've a java application and some ANT script to automatizations like > compiling, packaging and deploying stuffs. > > On my system I had two application servers and two databases one for > "master" and the other for "experiment". > There is a property files with the path of the two application servers > and the parameters to connect at the DB. > > The ant script automatically deploy on the right application server > and automatically set the properties to connect at the right database. > > This allow me to clean my experimantal database everytimes I need to > and start over by a clean situation and keep the "master" one > populated with all the data so I can do stress test/update procedures > test and so on... > > At the moment I manually modify that property files when I checkout > one of the two branches and I need to deploy it to test or whatever. > > > > Is there a way with Git to automatically switch that file when i > switch through branches? > It would be really perfect if I could also keep version of that file > so that when I checkout an old commit I had the options I was using > when I was testing that commit. > > Ideally that means that should be some files that are kept within each > commit but they are not pushed to a remote repository. > (Even if i'm talking about pushing I'm using git-svn because my > company still use SVN as versioning system so I don't push but i do > git svn dcommit when committing on a remote repository) > > How do you manage situation like this? I am in the same situation. What I did is not to add these files to .gitignore. On my "work" branch, I commited these files in a separate commit "local changes". When I want to push to svn, I switch to the branch "master", and cherry-pick the commit I want to push. $ git checkout master $ git svn rebase $ git cherry-pick work $ git svn dcommit $ git checkout work $ git rebase master This workflow could maybe be better. Suggestions welcome. Yann -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html