eddiemoya

Better Git

Snippets and tips to make you better with git

Retrieve deleted files from history

In the course of development, there are times you want to look at or retrieve a file deleted sometime in the past – and you probably don’t know when it was deleted. I’ve written a simple git alias that makes it super easy.

Interact With a Branch, Without Checking it Out.

Tricks for interacting with a branch, without checking it out. Browse a directory, or view the contents of files.

Fetch not getting tags

I just ran into a little gotcha with regard how fetch handles tags. When it pulls down commits, you will usually see that it also pulls down tags. I was a little confused today when fetch was refusing to pull a tag that was clearly in the repository (“git ls-remote –tags“) lets you see tags available on the remote.

Find submodules by branch

Generally speaking Git is fantastic and easy to use – one of the few pain points is where submodules butt heads with branches.