Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

Marty Hitchcock
Marty Hitchcock
13,108 Points

Can a file in a git repo be excluded from merging branches?

My project has a staging, alpha and beta version and I have a corresponding branch for each one. I also have a config file with all the info relating to that specific branch which I would like to be in the repo but not get merged into the next branch. Is there any way to achieve this? From what I can tell the git ignore file removes it from the repo all together which means I would still have to manually change it every time I change branches.