Wednesday
Jul092008
On Switching to Git
Wednesday, July 9, 2008 at 4:53PM
Yes, I switched all my source control to git. I don't have a lot of insight to share so far, but I doubt I'm going to change back.
I work solo, only moving between a desktop and a laptop, so I'm not making huge use of the distributed capability. My previous writing on Git was occasionally mildly criticised for "ignoring" that aspect of Git. I'm not ignoring it, but I lack an understanding of how it really helps me. No, what's great about Git so far is the power of the tools for everyday operations. I'll mention the three that come to mind immediately:
git add -i
Interactive adding is a feature that, once tasted, I could never again live without. Clean-as-you-go is an important part of programming any large system which will inevitably have some crusty corners or old code that needs updated. Without the ability to selectively commit diff hunks, cleaning code as you go leaves you with the Tangled Working Copy Problem when you want to commit.
With Git, I work on a feature and feel free to tidy comments, whitespace and adopt the dot accessor as I go. Later, I can go through the file and pick out the feature hunks, commit those, then commit the rest of the tidying-up work.
git bisect
Bisect is an unbelievably useful tool. It helps you to isolate the commit that introduced a bug. You give it a known-good commit, a known-bad commit and it searches through the commits in between, repeatedly checking out versions for you which you then test and tell Git whether that commit was good or bad. I've isolated several bugs with this already. It's fantastic.
git log
The tools that Git gives you to manipulate, search and output the commit logs are very powerful. There are too many options to discuss each here, but I find the ability to format the output with very fine control is particularly useful. With a little care in writing the first line of commit messages, I can use
speed, etc.
Performance is a feature, and Git is blazingly fast (unless you want to check in very large files). I don't know if it's the new-toy effect, or that I've been working like crazy, or that interactive commit makes it easier, but I find that I've made many more commits than I usually do. This really helps for the odd time that one might, er, accidentally introduce a bug.
What's Been Hard?
The first thing that was hard was pushing my converted SVN repositories to Github. Not that there was anything wrong with Github, but Git just wanted to eat all my RAM and then some more. This was with the FlickrExport repository of ~1000 commits. It turned out that Git was attempting to repack the repository before transmitting it. It appears that Git does this with no concern for the RAM requirements of doing so (sorry, Git fans, I don't have a better explanation right now). In the end, I had to run
With any change comes some unlearning. One of the biggest things is that you do everything in Git in one directory. If I had branches in Subversion, I was used to having them in different paths. In Git, you're always in the same place. Sometimes, I forgot which branch I was working on. Fortunately, Jon Maddox posted some really useful bash-fu to put the current Git branch in the shell prompt. Problem solved.
I'm slowly getting used to git stash but, this morning, I sat down to my machine and, well, where was all the code I wrote last night? It seemed to be gone! Twenty minutes of poking around later, I remembered that I had done git stash the previous night in order to build a specific tag and had not un-stashed it. Again, problem solved but not without a little panic.
So, in summary, Git's a great tool. It's about way more than just being distributed, though. There's a quieter evolution going on in the more mundane parts of SCM too.
I work solo, only moving between a desktop and a laptop, so I'm not making huge use of the distributed capability. My previous writing on Git was occasionally mildly criticised for "ignoring" that aspect of Git. I'm not ignoring it, but I lack an understanding of how it really helps me. No, what's great about Git so far is the power of the tools for everyday operations. I'll mention the three that come to mind immediately:
git add -i
Interactive adding is a feature that, once tasted, I could never again live without. Clean-as-you-go is an important part of programming any large system which will inevitably have some crusty corners or old code that needs updated. Without the ability to selectively commit diff hunks, cleaning code as you go leaves you with the Tangled Working Copy Problem when you want to commit.
With Git, I work on a feature and feel free to tidy comments, whitespace and adopt the dot accessor as I go. Later, I can go through the file and pick out the feature hunks, commit those, then commit the rest of the tidying-up work.
git bisect
Bisect is an unbelievably useful tool. It helps you to isolate the commit that introduced a bug. You give it a known-good commit, a known-bad commit and it searches through the commits in between, repeatedly checking out versions for you which you then test and tell Git whether that commit was good or bad. I've isolated several bugs with this already. It's fantastic.
git log
The tools that Git gives you to manipulate, search and output the commit logs are very powerful. There are too many options to discuss each here, but I find the ability to format the output with very fine control is particularly useful. With a little care in writing the first line of commit messages, I can use
git log to produce a rough set of release notes (I don't have the exact command line on this machine to copy and paste right now).speed, etc.
Performance is a feature, and Git is blazingly fast (unless you want to check in very large files). I don't know if it's the new-toy effect, or that I've been working like crazy, or that interactive commit makes it easier, but I find that I've made many more commits than I usually do. This really helps for the odd time that one might, er, accidentally introduce a bug.
What's Been Hard?
The first thing that was hard was pushing my converted SVN repositories to Github. Not that there was anything wrong with Github, but Git just wanted to eat all my RAM and then some more. This was with the FlickrExport repository of ~1000 commits. It turned out that Git was attempting to repack the repository before transmitting it. It appears that Git does this with no concern for the RAM requirements of doing so (sorry, Git fans, I don't have a better explanation right now). In the end, I had to run
git gc --window-memory=200m by hand to limit RAM usage, and then push it to Github.With any change comes some unlearning. One of the biggest things is that you do everything in Git in one directory. If I had branches in Subversion, I was used to having them in different paths. In Git, you're always in the same place. Sometimes, I forgot which branch I was working on. Fortunately, Jon Maddox posted some really useful bash-fu to put the current Git branch in the shell prompt. Problem solved.
I'm slowly getting used to git stash but, this morning, I sat down to my machine and, well, where was all the code I wrote last night? It seemed to be gone! Twenty minutes of poking around later, I remembered that I had done git stash the previous night in order to build a specific tag and had not un-stashed it. Again, problem solved but not without a little panic.
So, in summary, Git's a great tool. It's about way more than just being distributed, though. There's a quieter evolution going on in the more mundane parts of SCM too.


Reader Comments (46)
No, I've noticed I'm doing more commits.
I think it's because git makes it much easier to make genuinely atomic commits, thanks to the interactive addition mode (or
git add --patch, which is what I usually use).I tend to branch to add a feature, work on that feature, commiting almost every atomic change as a single commit on my local repo... and once the whole feature is complete, I checkout master, merge in the branch, and then push.
So I'm pushing fairly infrequently - only when I have a complete feature - but I'm commiting more often than normal, because I want the granularity in my local repo.
I'm working with another developer on git, so the granular-commit-versus-infrequent-push pattern works really well... but I think it's just how the tool wants to be used.
I also commit more often because it's faster than svn. When things are quick, you do them more. Cf: speeding up unit testing so it's something you choose not to skip.
To follow on from Tom, there's not only the insentive to check in more frequently, but sometimes you don't want to push all your minor checks to a central shared repository. With rebase you can coalesce commits too, so you don't end up spamming everyone with your obsessive commits habit if you don't want to.
Just FYI: There's also "git add -p", which gets you directly into the hunk selection without the menu and everything else. I usually use this more than "add -i".
You should also take a look at rebasing with the "--interactive" flag. This allows you to reorder, squash or delete commits as you see fit, and can be a very useful tool on occasion. However, this does rewrite the history, so you have to be careful with regards to changes that have already been pushed elsewhere.
Finally, "git cherry-pick" allows you to pick certain commits from another branch and merges them into your current branch. Not sure if you actually need this, but it's very handy sometimes when you work with other people.
Bonus: You can add aliases to git with "git config --global alias. <the command(s) you want aliased". So you can, for example, create an alias to see all the changes you've staged in the index with "git config --global alias.staged 'diff --cached'"
Erm. that should be "hyphen hyphen interactive" and "hyphen hyphen global".
The Tangled Working Copy Problem has been my primary link sent to developers I know that use SVN. They come back minutes later, going, "Oh my god. That's incredible."
http://cbowns.com/cpuhistory" rel="nofollow">CPU History was developed start-to-finish in git, partially as an experiment, and partially to force me to really give it a try. It went quite well for me, I think, and even though I was mostly working on the app by myself, in WiFi-aware locations, not worrying about commits to a central server was fantastic.
git rebase --interactive is a saviour when only a few changes from an experimental branch or commit work out. The Tangled Working Copy Problem did it justice: "…a bit like git commit --amend hopped up on acid and holding a chainsaw". So much fun to use, and worth learning.
Following on from the most-frequent-commits, I had an epiphany of sorts in the shower this morning.
In the past, with subversion, I'd tend to create a commit message which contained a summary and a list of bullet points describing those changes. Now, in git, I create a branch named after the summary of what I intend to do, and what would have been each bullet point gets its own commit.
It so happens that, when you git merge back to master, the merge message is virtually identical to the monolithic commit message I used to create. Hence the 'epiphany' this morning. :-)
Snap. Glad to know that other people feel the same.
Snap snap. Git is jist gitting bittir iviry day.
Great Post. thank for this share. I like tis and agree with you
I had a glass, it is very beautiful and quite fascinating. i'd appreciate it, and care for it! one day, accompanied by a ringing sound of glass was broken. i'm very sorry, links of london was very sorry, all my efforts were past never returns the east! feeling the same is true. once i had a poignant, alike, but now i was no anything. until now i have not yet relax, you can't lay her affect me! But there is a kind of [url=http://www.linksoflondonstore.com]links of london[/url], for his bad performance and school
A LEAMINGTON-based Water Dispenser company has clinched hot water dispenser worth more than pounds 500,000. Plastic cold water dispenser Engineering, of Juno ice maker Drive, Spa home water dispenser Business fended off Bottled water dispenser stiff competition cocktail dresses to land the deal cheap bridesmaid dresses with American wholesale evening dresses car components Carbonless Paper manufacturer TRW Lucas pos paper Varity Electric Thermal Paper roll Steering (TLES). It will Fax Paper supply the Computer Paper American firm with elegant wedding gown thermoplastic injection moulded parts for a wedding dress new electrical power-assisted steering (EPAS) system.
On cold water, tiffany star light wave, tiffanys I use if those who smoke, tiffany sale bamboo slips down after you left, I never know who the scattered floral gold? tiffany co I use words down residual acacia, never with delusion, "said thoughts will be broken, and finally string who listen to?" www.tiffanyjewelry.us.com Even if it is someone you can understand, tiffany silver but Tiffany jewellery will bring you different touches.
Even if it is someone you can understand, tiffany but Tiffany jewellery will bring you different touches. tiffany jewelery Clean air quality and accomplishment, tiffany jewellery like, Tiffany Charms what I have written, Tiffany Bracelet I have hatred, tiffany wholesale I love, I hate you can read and understand.
Moncler
Moncler jackets
Moncler outlet
Moncler sale
Sale Outlet provides designer Tiffany Ring,UK Tiffany Jewellery,www.sitetiffany.com
TIFFANY BRACELETS
TIFFANY PENDANT
TIFFANY EARRING
TIFFANY 1837
While you are in need of operate, you may need a hook intended to make your resume differentiate themselves from the opposition. Certification to provide a <A HREF="http://www.testhope.com/70-536.html">70-536</A> not merely provides proof of proficiency with Microsoft 'office' products, it exhibits a potential employer your resolve forpersistance to professionalism, trust , continuous self improvement.
Lots of individuals pick self-study to get ready for your <A HREF="http://www.testhope.com/70-663.html">70-663</A>, but that can leave essential holes as part of their knowledge when it is time for your exam. As one example, let's look at the testing requirements of MS Excel.
MS Excel courses supply you with every single benefit when using the Excel study of the MOS certification. Doesn't necessarily quit with MS Excel. Is to be found in Word, PowerPoint, Access, and Outlook to get ready you per element of the certification process. Taken by means of specialized MS coaching facilities courses, you are able to master the particulars of each <A HREF="http://www.testhope.com/70-236.html">70-236</A> in precisely 2-5 days of instruction and you will be willing to add "Certified Microsoft Office Specialist" towards your resume very fast.
Watch is the necessary thing in the life, so choose a good watch is very important, thomas sabo watches can solve you problem. The lines and design of the watch is cheap thomas sabo distinctive from other, some watch seems to remind you that time is passing by Abercrombie & fitch outlet, you will grow old, it will make you tense Abercrombie uk, while this kind of watch make you feel relax, it thomas sabo store seems tell you that we should enjoy every day Abercrombie outlet, every minute, every second. abercrombie fitch mens abercrombie and fitch womens thomas sabo jewellery abercrombie fitch jeans thomas sabo chain cheap thomas sabo thomas sabo bracelet pearl thomas sabo heart abercrombie sweater abercrombie fitch shirts thomas sabo charm watch thomas sabo earrings thomas sabo necklace Life is beautiful. cheap abercrombie fitch abercrombie gilet That isthomas sabo pendants discount why so many people like thomas sabo.abercrombie fitch hoodies abercrombie and fitch polos abercrombie and fitch london shop abercrombie online storeby many women in the world. That is because there are many styles and the texture is good, most of the jewelry are made by sliver, gold and thomas sabo necklace
pearl.
Links of London was ste up in and Herve Leger a Britain nodern jeweller Five Fingers . Links of London main products are sterling silver and gold jewellery, watch and gifts which apple peel 520 are designed and Herve Leger Dress manufactured by Links of London.The headquarters of Links of Links Sale, Links of London rings and till now there are 84 specialty stores and 211 retail shoppes in 9 countries, such as the UK, China, America, Japan and so on. Undoubtedly, Links Earrings Would be the Best C Apple Peel Wearing for Festival</p><p>Many people like Links of London silver jewellery since its exquisite design,Links Jewellery Sale refined craftsmanships and the moderate price peel 520. The Tamper of Are in view of Your CarelessnessThe silver jewellery will tarnish after a long time wearing since it is easily oxidation. Why Honey all Choose Links of London Sale ? God Knows!You can bring them to jeweler's shop and your jewellery will acquire a completely new outlook. What is the Future of Appealing Cheap Links Charm Bracelets? God Knows! Links Earrings The silver jewellery can be scrubed when the oxidation is not serious. Links of London watches There is a kind of silver polish cloth which is easy to Links jewellery 1990 brighten your silver jewellery,Links Sweetie bracelets only for those has some hardness and slippy character.You'd better use the silver leaner to Links of London Sale clean them if they are soft necklaces or carving jewellery with knockout. Links Jewellery outlet for Valentine's Day Five Fingers Shoes, Links Charm Bracelets a special international jewellery brand holds the wisdom Five Fingers Online, spirit and quintessence of London. Creative designs, incomparable exquisite crafts and best materials Vibram Five Fingers make the perfect combination which is the reason for choice. Five Fingers Store The proper price, Vibram Fingers at the meantime, Five Fingers Running is one of factors to consider. friendship bracelet Fashion News: Cheap Links of London are the First In Autumn and Winter of 2010</p><p>The design idea of Five Fingers Wholesale is "combine stylish conception Herve Leger Outlet with exquisite design" and it always markets some surprising new products. Barefoot Sports Shoes Invest In Like a Pro: Toe Shoes The Ultimate Five Fingers Sale </p><p>Trend Bible to Shopping for 2011 New Arrivals Links Classic mixes together with trend and creative, Cheap Five Fingers and bracelets are some of its in-demand products Vibram Five. The Correct Opinions and Misunderstanding of Links of London 2011 Fashion Trend for Spring 2011: Cheap Links of London Watches Hey! How Can You Disregard In links of london outlet, links london , The Best Birthday Crafts for HoneyReally?! Kate Beckinsale Wear Links Jewellery in Job Interview!Sales of Links Watches What Present an Appearance? Links Friendship Bracelet What? Beyonce Also Buy 2011 New Arrivals Links ! Five Fingers Outlet Kate Winslet even Bought links london sale for Mother! Get Ready Fast & Quick and Easy Ways for Links of London Charms
Many of us choose self-study to prepare in the <A HREF="http://www.testhope.com/70-623.html">70-623</A>, but which may leave important holes within their information as it reaches time towards the exam. One example is, here are the testing specifications of MS Excel.
Discovering how to organize and analyze your details is part of the <A HREF="http://www.testhope.com/70-557.html">70-557</A> procedure. Proper formatting of the spreadsheets gives your presentations much more power to present that information within an understandable way. Customization of the Excel application enable you to perform well and accurately.
If you end up trying to find operate, you will need a hook which may you could make your resume stand out from your competition. Certification as being a <A HREF="http://www.testhope.com/70-635.html">70-635</A> as well as supplies evidence of proficiency with Ms office products, it exhibits a potential employer your commitment to professionalism, trust , continuous self improvement.
We set in motion <A HREF="http://www.testhope.com/70-292.html">70-292</A> VAR business venture worldwide without any subsequent money/investment through 2007 and now we are present in main US business enterprise metros, contain intercontinental satellite tv for pc workplaces inside Brazilian, Russian federation plus Europe. Here we would like to share our new practices: Internet website marketing 1 . in comparison with the usual think you can easily take advantage of off search results and put the web-site topside job, many declare that this can be basically out of the question. Nonetheless paradox consistantly improves truth internet based might be the top markets. For that reason it's essential to devote most of your product initiative using the internet. Just about every redirect resolution with regards to suggested technique many of the methods should certainly provide and also be tested. During the new era of internet marketing the condition involved with harsh event makes most important stance. Should search back up <A HREF="http://www.testhope.com/search.html">70-547</A> you will find modern firms making use of common marketing processes: ordering town plus local call email lists, making phone calls then endeavoring very hard revenues finalizing tactics, for example , "selling on the top"-IBM type, supplying VITO (quite important first rate officer), etcetera. It again have operate the days of the past. We will care to so that you can sai why these years have ended these tips are usually obsolete. Look at your products or services collection For customers and therefore sales opportunities will visit and also recognise all the well trained in your soul, reading through your entire books. Individuals suit * a number of us stake relating to Products and services: Microsoft Outstanding Plains, Microsoft CRM, Navision and additionally Milliseconds RMS. We have been creation ezines at the each week schedule searching to retain our own community forum helped with over the normal footing. You could make your collaborators and additionally subcontractors network system ; if you are smaller than average next to choices the most impressive you can try to hurry your growth can be to significant other to many other current market professionals what person could help you opened the doorway toward brand new prospective customers and therefore shut down all of the income. Pay off ones families and then subcontractor 1 . It has trendy manner of wishing to hammer out reducing the actual and don't pay off on time. This video game is not really really good, yet , <A HREF="http://www.testhope.com/70-305.html">70-305</A> is normally appropriate if you are tremendous corporation. As long as you're smaller sized As you should not have fun with playing this particular card , your main partners don't buy from individuals in the coming years.
Studies have shown that firms that implement a <A HREF="http://www.testhope.com/70-292.html">70-292</A> certification program see far reaching advantages. Employees hold the training to increase their productivity and they are meant to really feel important which includes a company-financed expert certification. It sends a note to customers that your potential company employs skilled specialists to present the top service feasible.
Microsoft is designed not just to offer instruction to help make the workers more beneficial, but to provide the proficiency required to pass the certification courses. As an example, here are how <A HREF="http://www.testhope.com/70-693.html">70-693</A> courses prepare your employees.
Prior to deciding on a training facility, look into the length of the courses, the standing of the education facility, as well as structure of one's applications. The ideal applications will be the that teach numerous critical abilities to give employees new self-confidence with Microsoft applications together with prepare them for the types of abilities required at the <A HREF="http://www.testhope.com/70-305.html">70-305</A> certification exams.
Well,I wonder if you may like sports,you can take
jordan shoesinto consideration.I believe jordan shoesis wonderfull.It makes us feel like a bird flying on the sky.Our body will be light-footed and swift while sporting.
I suppose maybe you have interests in sporting.What brand would you like? I think new jordan shoes are wonderful,right?new jordan shoes make us powerful and comfortable,new jordan shoes also let our body feel breathable exactly!
href=
Do you ever know about the funny vibrams five fingers and what do the vibram five fingerslooks like?Do you realize the making principle and function of vibram five finger shoes?Now I am very happy to talk about vibram five fingers sales with all of you because I just know somewhat about five fingers vibram.The rubber sole of vibram fivefinger shoes are quite soft.You may feel strange when you wear vibram five fingers sale first time.But you will feel very comfortable after you wear vibram fivefingers several time.Then you are supposed to know that vibram five fingers can protect our feet to a great degree.You can keep the right posture of you feet when you put on this interesting vibram five finger sale.With vibrams five finger,you can feel motion of you body sensitively.And then you can adjust to you walking posture.This is why vibrams fivefinger shoes can avoid some disease for incorrect walking posture.It have wide kinds of five finger vibrams such as Vibram Five Fingers Shoes Classic,Vibram Five Fingers Shoes Sprint,Vibram Five Fingers Shoes Performa,Vibram Five Fingers Shoes MOC,Vibram Five Fingers Shoes KSO Terk,Vibram Five Fingers Shoes KSO,Vibram Five Fingers Shoes Flow.As vibram fivefingers for sale are made according to foot of human,vibram 5 fingers is more anti-skidding,wear-resisting and well-knit compared to ordinary shoes.So vibram five fingers for sale can be as rock shoes and you can enjoy various of outdoors activities as much as possible.vibrams 5 fingers have huge function of health care and physical therapy.You will feel soft,comfortable and keep you feet dry having vibram fivefingers sale. fivefingers vibram would take health for all of you.vibram five fingers on sale .
gold sequin dresses
bridal gowns beach
designer wedding dresses 2010
black sequin dresses
Short Sleeve Wedding Dresses
petite dresses special occasion
wedding short dresses
designer wedding dresses
plus size petite dresses
petite clothing
sexy wedding dresses
wedding dresses online
plus size petite dresses
petite clothing
modest wedding dresses
vintage bridal gown
macy's dresses
jcpenney dresses
pink wedding gowns
carolina panther
sears dresses
forever 21
Wholesale Evening Dresses
short prom dresses
8th grade graduation dresses
prom dresses
wedding dress plus size
womens cocktail dresses
fashion bug
dress barn coupons
quinceanera dresses
prom dress shops
dillards
Strapless Wedding Dresses
casual dresses
davids bridal prom
dress wholesale
summer dresses
work dresses
celebrity wedding gown
cocktail dresses