Advent Day 23: Removing Large Binaries with LFS
December 23, 2018
Earlier this month I talked about Git Large File Storage (LFS) and how you can use it to avoid checking in large files. It will keep those files in a separate area, parallel to (but not actually part of) your git repository, where they have a different storage contract that's efficient for large files. But Git LFS needs to be set up before you add the binaries to your repository - once they've been checked in, they're in history. But what if you've already added binaries to your repository? How do you get them out?
Read more
Advent Day 22: libgit2 and Friends
December 22, 2018
I love scripting against my git repository. Often I'll have an idea for a quick and dirty tool that will help me get my work done - for example, git recover, which helps you locate files that were accidentally deleted from your working tree that never got checked in. But scripting against git generally means writing Bourne shell scripts and parsing text output. That's fine for simple jobs, but it gets frustrating quickly if you're trying to do something more complicated. That's when I reach for libgit2.
Read more
Advent Day 21: Renormalizing Line Endings
December 21, 2018
This month I've given a few tips and tricks that I think are important - for example, getting your line ending configuration right. But a lot of these settings require you to get them set up in the initial commit, ideally before you start adding content to your repository. But development - like most of life - isn't always so simple. What if you've already committed changes? And you've been using core.autocrlf inconsistently, instead of using a .gitattributes? So you've got a mix of line endings in your repository? Thankfully, that's an easy fix.
Read more
Advent Day 20: Force with Lease
December 20, 2018
I've highlighted a few Git GUI clients this month: GitKraken, which supports macOS, Windows and Linux, and Tower, which supports both macOS and Windows. But today I want to mention a surprising GUI client: Working Copy. It's surprising because it's not a GUI client for a "proper" computer, it's a GUI for ... your phone.
Read more
Advent Day 19: Working Copy
December 19, 2018
I've highlighted a few Git GUI clients this month: GitKraken, which supports macOS, Windows and Linux, and Tower, which supports both macOS and Windows. But today I want to mention a surprising GUI client: Working Copy. It's surprising because it's not a GUI client for a "proper" computer, it's a GUI for ... your phone.
Read more
Advent Day 18: Conditional Includes
December 18, 2018
If you're a professional programmer who also works on open source software, then you might want to keep your work identity a bit separate from your personal identity. For example, I always use my personal email address when I'm working on my personal projects and open source software. In contrast, I always use my work email address when I'm committing to my work repositories. At least, I try to always do that. One of the things that helps ensure that I keep this organized is Git's conditional includes.
Read more
Advent Day 17: Whitespace in GitHub Pull Requests
December 17, 2018
I hope that I've encouraged you to get your .gitattributes set up correctly so that everybody on your team is committing with the same line ending configuration. But maybe you haven't had time to fix that yet, maybe you're on holiday, or, heck, maybe you don't even care... 🤯 Even if some people on your team are still committing files with CRLF line endings, while others are committing with LF; some tools like GitHub have you covered.
Read more
Advent Day 16: All Things Git
December 16, 2018
I hope you'll allow me a moment of shameless self-promotion: one of the great luxuries of my job is that I've been able to meet so many great people who are working on development tools, on helping people use version control, and to be better software developers in general. And since I have so many great conversations with people, I decided to start recording them, along with my buddy Martin. The result is our podcast: All Things Git.
Read more
Advent Day 15: Tower
December 15, 2018
Earlier this month, I suggested GitKraken as a graphical Git client. But just like you might prefer spaces over tabs (gasp!) or dark themes over light ones (what!?!), different people have different preferences when it comes to their Git clients, and I'd encourage you to try a few to find the one that you like. Another great one is Tower.
Read more
Advent Day 14: gitattributes for Binary Files
December 14, 2018
Earlier this month, I talked about using .gitattributes to handle text files. And I talked about using Git LFS for large files. But what if you have small binary files that aren't so large that they warrant using Git LFS, and you want to keep them in the repository?
Read more