Advent Day 13: Setting Files Executable on Windows
December 13, 2018
When you're working on cross-platform projects, you often want to create a single set of scripts that works on all the platforms that you're targeting: Linux, Windows, macOS, maybe even some more exotic or legacy Unix systems. There are a number of scripting languages that will work on all of those: but whatever scripting language you choose, one thing is certain: you'll need to set those files executable on Unix platforms, and that's simply not a concept that exists on Windows. So if you're creating new scripts on Windows, you'll need to find a way to set those files executable when you commit them to support running the scripts on Unix machines. Thankfully, Git has you covered.
Read more
Advent Day 12: git log --since
December 12, 2018
Earlier this month I mentioned how you could the visibility into git's logging with some helpful aliases. But another way to gain visibility into the commits that happened is with the --since option to git log (or git lol if you prefer). The --since option lets you narrow the history that you're viewing to - well - commits that have occurred since the date that you specify.
Read more
Advent Day 11: Removing (newly) ignored files
December 11, 2018
Yesterday I suggested that you set up a .gitignore to keep your repository tidy from temporary files, binaries and local configuration files. But what if you've already added the files?
Read more
Advent Day 10: Add a .gitignore
December 10, 2018
You need to be mindful of the files that you're putting into your repository; and, perhaps more importantly, the ones that you're keeping out of it. You don't want to check in local configuration settings for your IDE that affect the rest of your team. You don't want to check in editor temporary or swap files that will just give you pointless merge conflicts. And you definitely don't want to check in private keys or cloud provider secrets. That's why you need a .gitignore file in your repository.
Read more
Advent Day 9: git lol
December 9, 2018
There are two commands I run more than any other: first, git status which lets me know what I've been working on. Second, git log which lets me know what other people have been working on. But I don't actually use git log. Usually I run git lol instead.
Read more
Advent Day 8: Git-LFS
December 8, 2018
Distributed Version Control Systems like Git are revolutionary: they're a huge productivity gain for working with versions of source code and text files and ... a terrible pain if you want to check in large files like images, movies or audio into your repository. That's because when you clone a repository, you'll get every copy of those large binaries. The solution to this is the Git Large File Storage extension.
Read more
Advent Day 7: Git Merge
December 7, 2018
The annual Git Merge conference is one of my favorites of the year. Git developers and users get together to hack, share tips, and plan the future. Over the past five Git Merge events, we've seen a few product announcements, several talks on how to scale Git, and many talks about using Git. Unfortunately, I can't make it this year, but you can. It's coming up January 31 and February 1 in Brussels.
Read more
Advent Day 6: GitKraken
December 6, 2018
The Git command line is a tricky thing. It's useful for all of the developers some of the time, and some of the developers all of the time. But for some people, it's not always the best thing to reach for. Over the last few years, the Git GUI market has really grown. We've seen some of the first Git GUIs really mature, and we've also seen new GUI tools launch. There are a couple that I'm really fond of, and I'm excited about each of them. One of my favorite Git GUI tools is GitKraken.
Read more
Advent Day 5: Review Pull Requests Locally
December 5, 2018
Reviewing pull requests is tough work: whether you're using GitHub or Azure Repos or another hosting provider, they all try their best to give you a powerful code review experience right in the browser. But no matter how good they are, for some changes you really need to get hands-on, to run the code, to step through it in a debugger to really grok it. Thankfully, GitHub and Azure Repos both expose pull request branches so that you can just fetch them locally and work with them.
Read more
Advent Day 4: 2FA and Git Credential Manager
December 4, 2018
You're using two-factor authentication (2FA), right? Right!? This simple change can increase your security - and the security of your source code - with very little effort. When you enable it, instead of logging in with just your username and password, you'll now also need to enter a 6 digit key from an app on your phone. The problem, though, is that while 2FA works great in a website, tools like Git on the command-line don't have support for it. Thankfully, there's a tool called the Git Credential Manager.
Read more