Every now and then, I encounter some complex legacy code that has been moved around and changed so much, git blame doesn’t help in finding the original commit. Git bisect is the solution here. Why the Original Commit Can Help Sometimes, I read code and (after a while) it becomes clear what it does. But I’m often left wondering why the code is there, what the context was. It allows me to read the commit message and maybe several commits

This may not be new to you, but I recently discovered another cool feature of Git. Rebasing with the autosquash option allows me to keep a clean log with minimal effort. I’ve written about interactive rebasing before. This makes it even easier. Interactive Rebasing You want to do an interactive rebase when you have a series of commits that need be squashed together or when you want to change the order. Let’s say you have the following commits: But then

Editorial note: I originally wrote this post for ASPE. You can check out the original here, at their site. When developers use Git, they often use a combination of a graphical user interface and the command line. A GUI has a low barrier to entry, but many of us want to leverage the power that Git CLI. Once you’ve learned the basics of the Git command line, you have some powerful commands at your fingertips. And it only gets better

Pull Requests have become a well-known concept in open-source projects, not in the least thanks to GitHub. But pull requests are also finding their way to the enterprise and closed-source projects. Making pull requests part of your team’s workflow might require some changes to your daily routine, but it will result in better code and better distribution of knowlegde. Let’s zoom in on that shall we? Experienced developers sometimes have the tendency to think they write great code while the

If you use GitHub, Bitbucket or VSTS regularly, you will be familiar with the term pull request. I believe GitLab uses the term merge request, but that it’s essentially the same thing (but don’t quote me on that). What you do is create some changes, and request another contributor to merge those changes into (usually) the main branch. The idea is to have a place where you can see the changes and have meaningful discussions about it. The pull request

So you want to make a quick-and-dirty application to test something? And you start and hack away? And it starts looking fairly good? And suddenly it stops working? Here’s a pro-tip: CTRL-Z. For the more down-to-earth devs: use a source control system. I find myself using it more and more, even for mini-projects: from small proof-of-concepts to a static, HTML-only website for a friend. I can strongly advise you to download TortoiseHg and get started. Then, next time you fire

I just go my AppHarbor build to work, and can definitely recommend it if you have a project of your own. It’s a builder server and hosting in one. I switched to Mercurial for this, but it will work with Git also. I just wanted to be able to tell the girls in the club that I use Mercurial. When I push my changes to BitBucket, AppHarbor will pull them in (it also works with GitHub, Codeplex,…), build my solution,

Update: This is an old article that helped us at the time, using a centralized version control system (Subversion). We created our own branching strategy, which I would heavily advise against these days. The issue with making up your own branching strategy is that, like most not-invented-here solutions, you’re probably not going to be smarter than the community. I recommend you choose a strategy that is widely known, like GitFlow or GitHub Flow. There is more documentation and support, and

Okay, I finally got Git to work. Here’s the necessary steps, after having installed msysgit and TortoiseGit. First, create the local repository. You’ll get a notification that an empty repository was created. You can now use the repository to track your changes. But of course, you want to push this stuff to a server, as backup, because other people will collaborate on your project, etc. I’m using Unfuddle so I’ll concentrate on that (check out Git for Windows Developers for

Git can be quite confusing in the beginning, especially coming from a subversion background. But once you’ve got it running, you realize it’s quite easy:install msysgitoptionally install something like TortoiseGitnow you need to create an SSH key, which is explained on the TortoiseGit site for Linux, but for Windows, it’s a little harder:open command prompt and navigate to where msysgit is installedenter the following command: ssh-keygen.exe -t rsa(use /? to see more info)enter your passphrase and the location to save