Last year, I found myself shopping at a major retailer. The store was having a great sale, and I found a fair number of clothes that fit me, all at an excellent price.

When I was checking out, the cashier offered me a big discount if I opened up a major credit card co-branded with the retailer. I had wanted to see what would happen to my credit history if I opened up a new line of credit. This seemed like a good opportunity.

Sure enough, even though I’ve had my other major credit cards for more than twenty years, just opening up this one new account directly affected my credit history and dropped my credit score by about thirty points.

If you were to open up a new credit account, it would have a different effect on your credit history and credit score than my new account did on mine. That’s because we all have different types of information on our credit history.

But this experience also explains why mortgage lenders will pull your credit history at least twice between the time you apply for and close on your loan.

In today’s new world of mortgage finance, lenders are tightening credit requirements. It’s far more difficult to get a mortgage today than it was five years ago. Even borrowers who have near-perfect credit histories with credit scores in the 800 range are being rejected for reasons that seemingly make no sense-like a small investment loss taken on a tax return, or an extra $500 deposited into a savings account that couldn’t be adequately explained.

Lenders are looking for risk-free borrowers-or as near to that as they can get. Your credit history is a snapshot of your financial life. By pulling a copy of your credit history as you apply for a home loan, the lender is determining whether your risk profile is acceptable. By pulling a second copy of your credit history just before you close, the lender is making sure nothing much has changed since the loan was initially approved.

(Remember that when you apply for a mortgage, the lender will pull a credit history for each person signing the loan, whether it is your spouse, partner, relative, or friend.)

What doesn’t the mortgage lender want to see on that second pull? New credit cards, new lines of credit, late payments, judgments, or any other negative information.

If you want to ensure that your home loan closes on time, get all of your bills paid on time and in full, don’t rack up any extra debt, don’t make any major purchases that you can’t pay off at the end of the month, and don’t open up any new lines of credit-even a small one.

The credit card I opened had only a $2,000 line of credit. I charged several hundred dollars worth of clothes and paid it off before the end of the month.

I saved 20 percent on the clothes. I cost myself thirty points in my credit score.

The good news is that six months later, with continued on-time payments, my credit score rebounded to just about where it was before I opened up that credit card.

How has your credit score been affected by new lines of credit you’ve opened?

Ilyce Glink is a best-selling author, real estate columnist, and web series host. She is the managing editor of the Equifax Finance Blog and CEO of Think Glink Media. Follow her on Twitter: @Glink