What I think I am supposed to do is create a feature branch, then when it is ready I merge it into the development branch then push it to the centralized repository. Then once approved I merge it into preproduction. How do I keep the files from the feature branch together to merge them from development into preproduction and then merge them again to production. What I really don't understand is how to know which files were from that no longer existing feature branch.
Asked
Active
Viewed 47 times
0
-
There are a lot of assumptions about what you must do. None of what you describe is technically needed. You don't need a prod branch, you don't need a preproduction branch. – jessehouwing Dec 01 '22 at 18:15
-
In one sense, it doesn't matter. Files that were created in the feature branch are part of the development branch now. The difference is that there is a commit in the development branch with *two* parents: one is the pre-merge head of the development branch, the other is the pre-merge head of the feature branch. – chepner Dec 01 '22 at 18:15
-
You probably also shouldn't promote individual features through merges. Once merged, assume they will ship and do whatever is needed to fix any issues that come up. That way you don't need to cherry pick anything, just merge the whole branch. – jessehouwing Dec 01 '22 at 18:16
-
We really do want to keep track of what is on the development server and preproduction server and production server. In our case having them tracked and separate is a requirement. – Wisconsin Wes Dec 01 '22 at 18:21
-
If you were to cherry pick the merge commit of the feature branch into its target branch, git would know exactly which files hat changed. Not that this is a great idea, but that's how git works. – jessehouwing Dec 01 '22 at 18:22
-
Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Dec 02 '22 at 12:35