git Tutorials

  • By
    Track Empty Directories with git

    There are times when you'd like to track an empty directory within git but there's a problem: git wont allow you to add a directory that doesn't have a file in it.  The easy solution is putting an empty stub file within the directory, and the industry...

  • By
    Git Hook – npm install if package.json is Modified

    Most of the projects I work on these days contain a frequently-modified package.json file to manage dependencies.  You would think by know I'd be used seeing the package.json file when I did a git pull and it would trigger something in my head to execute npm install to ensure I...

  • By
    Export and Import Patches with git

    Most of us that use git probably only have use GitHub -- thus is the popularity of their service.  If you (or a parent project) don't use a service like GitHub, however, you'll need to export patches for review.  Let's have a look at how to export a patch...

  • By
    git tag

    git tag is used to pin down a given revision as significant, often for the purpose of officially releasing code.  Once a tag is created, it's often referred to by build and deploy scripts instead of the tag's represented commit.  Tagging revisions  and deleting tags in git is easy...

  • By
    List Recent git Commits from Command Line

    GitHub is an amazing service which brings the boring, sometimes difficult git command line tool to life.  Oftentimes instead of futzing with the command line I'll simply bring up GitHub and find what I need.  In the year 2016, however, I'm trying to break away from GUI...

  • By
    Create a Global .gitignore

    The .gitignore file is cherished by developers because it can keep repositories clean after build files and OS-generated files (like .DS_Store) clutter the structure of your repository. What I find is that I'm constantly adding the same files and directories (like node_modules) to every repository...

  • By
    Create a Repository Archive with git

    Everything about git is amazing. And by "everything", I mean almost everything. As someone that used Perforce and SVN before learning git, I'm willing to ignore a few git annoyances since it makes branching and many other simple tasks easier. One good problem I have...

  • By
    Get Git Branches Checked Out on a Date

    I don't use any type of git UI -- I try to be hardcore and stick to the command line.  This makes git usage quicker but I also probably miss out on a lot of the functionality that would be nice to know.  The functionality is there, of course...

  • By
    Quick git Commit Searching

    While I love GitHub for the way it presents git repository information to me, I've been trying hard not to rely so much on GUI web apps and desktop apps, instead looking to use command line equivalents.  You see that in my recent shell posts, including 

  • By
    Git Update Commit Message

    One of my faults as a professional developer is that my commit messages aren't always as descriptive as they could be.  Sometimes I even notice a spelling error in them.  Bleh -- that's not cool, man.  When I do catch that my last commit message isn't good...