Creating git bundles you can clone from

I always thought git bundles were fancy to use. You could carry them on a drive and clone them without requiring the internet. I regularly update my basic rails bundle which I create from repos using

Trying to clone (git clone basic-rails.bundle) from that bundle gave me an error I couldn't understand. I had cloned from the bundle which I had created from a clean no-errors repo.

"warning: remote HEAD refers to nonexistent ref, unable to checkout"

A bit of googling and then someone's StackOverflow post enlightened me. It seems that to be able to clone from a bundle you have to use the --all flag like below.

And now when you try to clone from such a bundle, it'll work fine :)

I've created a github repo for my git bundles. Somehow I feel having bundles in a repo helps and is far better than creating a repo for each starter app.

Posted
 

Removing cached or initialized files from git [or what's happening when you think gitignore is broken]

Today I had a horrid 15min trying to figure out why git isn't ignoring my database config file inspite of adding that to the repo's .gitignore. I dug through the gitignore files of all my other repos and it seemed like I had done everything right but still the file I asked git to ignore wasn't being ignored.

Finally, found out what caused the issue. Me. I had already added the database config file to a repo. I should have added it to the .gitignore file even before trying to make my first commit. It seems that git tracks all files you add to it before adding it to .gitignore. So you'll have to remove it from git's cache when you add it to the .gitignore.

 

Posted
 

Git undo commands to the rescue

Improved my gitFu to level-5. haha. learnt some handy undo commands in git. I often do too many commits for every damn typo fix. Learning these commands should fix my problem :)

Posted