Git For Web Programming #1
Monday, August 31st, 2009![]()
Git is a powerful version control tool, so powerful, even more so than with subversion, you yourself define the strategy that you use to employ it’s features. There are myraid ways of doing things and what’s best really depends on what you are doing. In my opinion two of the most important features of git are the ability to easily track incremental commits during development without breaking the entire build for all users and it’s support for sharing commits between branches. Both of these features solve major problems with subversion, in which there is no way to commit changes that aren’t ready for primetime while still retaining a readable revision history in the repository.
Beyond these features though, I have found a few capabilities within git that are ideally suited to web programming. One is the use of the rebase option to update live sites while keeping those sites on version control. Often, once a site is live either the installation environment or extensive use will uncover latent bugs in the build. Sometimes it’s quickest to just fix these on the live site, and move them back into the repository trunk from there. If the site is not on version control, copying of files is the only option, thereby losing detailed commit history. On the other hand, a live site has different database and server settings, sometimes intermixed in settings file that have configurations that are global to both development and live installations. Git rebase can be used to solve this in a slick way.