We are a small software development company which started out with 2 people, but are now steadily growing. Therefore we need a development strategy using Git, but we are running into some issues. We are using Gitlab as our Git provider.
The situation:
- We have 3 environments all running different versions of the code: Development, QA and Production
- Each environment has its own Git branch: Development, QA and Production
- We usse Jenkins to pull and build the right branch for each environment. Currently this is not automated, but we intend to automate this in the future.
- When starting a new feature or fix, we create a feature branch, by branching from Production. We code and merge our feature branch with Development, QA and Production when it is time to do so
Now the issue we are running into is that when we merge our feature branch into development and QA, using merge requests, we also see the changes done on production. But those changes are already merged with development and QA, so these have no effect. This however makes it extremely difficult to track commits and do code reviews.
We are a young team and this is our first time tackling such issues. It could be that we have to change our Git strategy completely, so giving some feedback on multiple possiblilities to implement different strategies is more than welcome.
git merge --squash, you're generally best off killing off the branch on which you made the original commits. You trade N original commits for one single commit that does what the N original commits did. Depending on the original commits, this can be good or bad (or a mix).