How to Get the Most out of Git

first_imgRelated Posts Cameron Laird is a vicepresident with software consultancyPhaseit, Inc., andpart-timeauthor concentrating on IT.He has used and evaluated version-control systemssince before PCs. Follow Cameron on Twitteras @Phaseit. Why You Love Online Quizzes How to Write a Welcome Email to New Employees? cameron laird Longer fully-qualified names in the Git repository vs.a requirement to symlink into a host’s standardconfiguration directories: which do youfind more natural and “self-documenting”?Version control is more than source controlIt was common with Git’s ancestors to talk about“source code control”; for a variety of technicaland cultural reasons, some of the older-generationtools didn’t handle binaries or certain other formatswell.That’s really a thing of the past, though. Whenyou use Git today “for version control of files”,as the Git home page advertises, control allyour project’s files: images, documentation,associated presentations, pertinent database testinstances, build specifications, video-ed instructions,and so on.Like the point about naming above, the idea ofcapturing everything isn’t specific to Git.As Git’s popularity has exploded, however, itseems that quite a few newcomers to version-controlhave taken it up; some of them don’t yet understandeither how valuable it is to control non-textartifacts, or that it is technically feasible.Make your project “self-sufficient”: when someoneissues the command git clone $TOP_URL,you should be confident that the clone includeseverything necessary, without having to pick upmiscellaneous pieces in separate operations.Recent Git newsGoogle Code supports Git; that is,Google Codehas, since mid-July 2011, acted as a serverwhich fully honors Git client requests. You can combine theadvantages of Google Code and Git.The Google Code announcement reinforces thatGit is possible without GitHub. The GitHub public sitecertainly deserves the popularity and traffic it hasattracted. Sometimes beginners with Git don’t appearto realize, though, that there are alternatives toGitHub: not only can an organization set up itsown Git server, but public sites like Google Codeare right for some teams.At a lower level, several commands allow for combinationsof functionality from Git and other tools.git-svn, for example,makes it possible for users to getthe client functionality of Gitwhile working against a Subversion repository.If you or your team are making a transition betweendifferent technologies, look into such “bridges”.Recognize that Git isn’t for everyone; there aregood reasons to favorLaunchpad over Github, for instance (also seethis,this,this), orMercurial over Git (also seethis).As with so many important matters, perhaps what matters mostin version control systems is balance: version control isonly a tool, not a goal in itself. On the other hand, expertisein the tool can multiply your effectiveness with the code thatpresumably is your focus. Study more about version control andwhat it can do for you through such good write-ups as, forexample, Eric Sink’s website. Here are a handful of tips you should know to makethe most of thissuccessful open-source tool, andits close relatives includingSubversion:Choose your top-level name well. I often come acrossGit projects set up in a way that I think createsa minor but avoidable confusion. Suppose, forinstance, that a team decides to maintain configurationfiles for a specific Apache service for a particularclient, ImportantCompany, within Git. The filestructure then looks something like A new developer initializes her development instanceby performing I prefer a layout along the lines of Initialization then becomes While the difference to the front-line working programmeris, in one sense, only a single command (ln-s $WORKING_DIRECTORY /etc/apache2 becomesunnecessary), my experience tells me that eliminationof thesymlink lowers the“cognitive load” on programmers and simplifiesmaintenance. I also think it’s healthy to make it explicit that apache2.conf andother artifacts have their natural home in afolder or directory called apache2. …/ImportantCompany/apache2.conf …/ImportantCompany/mods-available/actions.conf …/ImportantCompany/mods-available/actions.load … cd /etc git clone https://$SERVER/ImportantCompany/apache2center_img Git has become the programmingworld’s most popular version control system–at leastthat’s whatsurveysconducted by Microsoft Corp. suggest.While there are abundant write-ups already availablefor new users and administrators, from tutorials todescriptions of clever merge workflows, I stilloften encounter a few misstepsin basic version control naming and layout. …/ImportantCompany/apache2/apache2.conf …/ImportantCompany/apache2/mods-available/actions.conf …/ImportantCompany/apache2/mods-available/actions.load … 7 Types of Video that will Make a Massive Impac… cd $WORKING_DIRECTORY git clone https://$SERVER/ImportantCompany ln -s $WORKING_DIRECTORY /etc/apache2 Tags:#Analysis#hack#tips Growing Phone Scams: 5 Tips To Avoidlast_img

Leave a Reply

Your email address will not be published. Required fields are marked *