1

I work with both a Production and a Development version of a website. Sometimes I'm asked to do a quick modification on Prod (like adding a product) while I'm working on the development version too, which could result to confusion between the prod site and the dev one.

My solution to this was to change the main color of the site on development (local only, for myself) to quickly identify which one I was on. The problem is that I don't want to commit this modification on prod ever, but I don't want to do it / undo it for every branch I create either.

Which leads me to this question:
How can I untrack a portion of a file without untracking the whole file?

//Do not track here ever
- --colorMain : red
+ --colorMain : green
//Start tracking again
(rest of the file)

Or maybe there is just a better solution to my problem. Thanks in advance!

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
  • `git stash` does not do what you need? – eftshift0 May 26 '23 at 12:37
  • 2
    Could you keep a development configuration and a production configuration and use them on their respective versions of the website while keeping both versions in your versioning system? – DanielBarbarian May 26 '23 at 12:40
  • 1
    Unless there is some extension I'm unaware of that allows a single file to be stored as 2 or more independent blobs, I don't think there is a way. – chepner May 26 '23 at 12:44
  • 1
    Our configuration for development, production, productionzyx and so on are in configuration files. They’re on a level “below Git”. Why is this a concern for the version control? – Guildenstern May 26 '23 at 13:29
  • 1
    It sounds like it is implied that “development” and “production” are two different branches (or family of branches: `dev/1`, `dev/2`). I see people asking a lot of these “branching” questions on SO where they want things to be tracked if X, Y, and Z, and it seems like a massive headache. Git is difficult enough if you use it for its _main_ job and not this as well. Maybe I have misunderstood though. – Guildenstern May 26 '23 at 13:30

0 Answers0