Reputation: 2498
We use GIT repos in conjunction with DeployBot.com (Deployment Platform) and FTP. Code in our repos is organised with topic branches.
In order to deploy code to a server, we simply commit latest changes, merge it with master (that branch is used for deployment) and the deployment platform transfers the modified files. The above approach works great in 90% of scenarios.
However, sometimes we need to test our code quickly on the server (it is not possible to do that in dev environment) but we don't want to commit these small changes every time to keep the repo history compact and clean. We don't also want to use FTP to directly modify files without committing them, since the modified files are out of our control.
I am wondering if you have the same problems and what approach you use to overcome it. Initially I was thinking about maintaining a special branch that could be used to keep all these "quick" one-time commits but I find it not elegant/agile and quite problematic.
All ideas are highly appreciated. Many thanks!
Upvotes: 1
Views: 464
Reputation: 116140
"However, sometimes we need to test our code quickly on the server (it is not possible to do that in dev environment)" - That's your problem right there, and you should make your dev environment as representative as possible, so you can test (almost) everything there.
For the other part, I don't see much harm in small commits. If you test it as much as you can in your development environment and you think you change might just work, I'd commit it.
But another possibility would be to setup the possibility to deploy from a fork as well. If you are able to deploy from a branch in a fork, you can make a test-deploy from your development branch and test it. After the test, you can restore the environment by a release from the main repository.
Since you have all your changes in a separate, unmerged branch, you still have possibilities to remove the branch altogether, or collect the changes of various commits into a single commit in a new branch.
So I think those are your options, although I think it's an ugly workflow. I'd rather fix the dev/test environment and learn to appreciate small commits.
Upvotes: 1