Git Starter Pack

commons.wikimedia.org/wiki/File:Git_session.svg

Git Starter Pack

Curated collection of info for using the Git Version Control System.

Edit

This content is open source. Help improve it.

Origin and History

  • A Git Origin Story

    A look at Linux kernel developers’ various revision control solutions through the years, Linus Torvalds’ decision to use BitKeeper and the controversy that followed, and how Git came to be created.

    Originally, Linus Torvalds used no revision control at all. Kernel contributors would post their patches to the Usenet group, and later to the mailing list, and Linus would apply them to his own source tree. Eventually, Linus would put out a new release of the whole tree, with no division between any of the patches. The only way to examine the history of his process was as a giant diff between two full releases.

  • 10 Years of Git: An Interview with Git Creator Linus Torvalds

    Torvalds: I really never wanted to do source control management at all and felt that it was just about the least interesting thing in the computing world (with the possible exception of databases ;^), and I hated all SCM’s with a passion. But then BitKeeper came along and really changed the way I viewed source control. BK got most things right and having a local copy of the repository and distributed merging was a big deal. The big thing about distributed source control is that it makes one of the main issues with SCM’s go away – the politics around “who can make changes.” BK showed that you can avoid that by just giving everybody their own source repository. But BK had its own problems, too; there were a few technical choices that caused problems (renames were painful), but the biggest downside was the fact that since it wasn’t open source, there was a lot of people who didn’t want to use it. So while we ended up having several core maintainers use BK – it was free to use for open source projects – it never got ubiquitous. So it helped kernel development, but there were still pain points.

Getting Started with Git Fundamentals

  • How to undo (almost) anything with Git

    One of the most useful features of any version control system is the ability to “undo” your mistakes. In Git, “undo” can mean many slightly different things.

    When you make a new commit, Git stores a snapshot of your repository at that specific moment in time; later, you can use Git to go back to an earlier version of your project.

  • Most commonly used git tips and tricks.
  • Working with Remotes

    To be able to collaborate on any Git project, you need to know how to manage your remote repositories. Remote repositories are versions of your project that are hosted on the Internet or network somewhere. You can have several of them, each of which generally is either read-only or read/write for you.

  • Writing Effective Commits

    If you haven’t given much thought to what makes a great Git commit message, it may be the case that you haven’t spent much time using git log and related tools.

  • managing-commit-signature-verification

    You can sign your work locally using GPG or S/MIME. GitHub will verify these signatures so other people will know that your commits come from a trusted source. GitHub will automatically sign commits you make using the GitHub web interface.

Outside of GitHub and its imitators, most contributors to a project don’t have a published version of their repository online at all, skipping that step and saving some time. - What is a Fork?

Cheat Sheets

Create Test Branch + Merge Changes

This is a little walkthru I made for myself when trying out a Hugo theme for this website. I made a test branch for the new theme, and merged the changes merged the changes to master, once I had it running.

Use the command git checkout -b will allow you to create a local branch for testing.

I called the new branch test-hugo:

git checkout -b test-hugo

git checkout -b creates a duplicate of your repository isolated from your working project, so you can test out and break things without effecting your working product.

git checkout master
git pull origin master
git merge test
git push origin master

Submodules

Resources

Gitflow Workflow

Gitflow Workflow is a Git workflow design that was first published and made popular by Vincent Driessen at nvie. The Gitflow Workflow defines a strict branching model designed around the project release. This provides a robust framework for managing larger projects.

git-annex

git-annex allows managing files with git, without checking the file contents into git. While that may seem paradoxical, it is useful when dealing with files larger than git can currently easily handle, whether due to limitations in memory, time, or disk space.