Git Icon

Git

Git is the most widely used version control system.
35 Stories
All Topics

The New Stack Icon The New Stack

How git changed the way we code

The New Stack takes us on a fun trip down memory lane:

Fifteen years ago a number of the Linux kernel developers tossed their hands in the air and gave up on their version control system, BitKeeper. Why? The man who held the copyright for BitKeeper, Larry McVoy, withdrew free use of his product on claims that one of the kernel devs had reverse engineered one of the BitKeeper protocols.

Linux creator Linus Torvalds sought out a replacement to house the Linux kernel code. After careful consideration, Torvalds realized none of the available options were efficient enough to meet his needs:

Drew Devault drewdevault.com

Drew Devault's unorthodox, branchless git workflow

In short, I use git branches very rarely, preferring to work on my local master branch almost every time. When I want to work on multiple tasks in the same repository (i.e. often), I just… work on all of them on master. I waste no time creating a new branch, or switching to another branch to change contexts; I just start writing code and committing changes, all directly on master, intermixing different workstreams freely. This reduces my startup time to zero, both for starting new tasks and revisiting old work.

If the blog post ended here, you might think Drew is crazy. But he goes on to explain how he uses rebase to clean things up before pushing upstream.

I enjoy hanging out on master quite a bit, myself. However, when I’m ready to take on something “big” or “gnarly” I don’t hesitate to git checkout -b and work from there.

Jonathan Carter github.com

GistPad for VS Code 📘

GistPad is a Visual Studio Code extension that allows you to manage GitHub Gists entirely within the editor. You can open, create, delete, fork, star and clone gists, and then seamlessly begin editing files as if they were local.

The big idea here is to use gists to seamlessly create your “very own developer library”. The interactive playgrounds is pretty cool, too.

GistPad for VS Code 📘

Victor Zhou victorzhou.com

Git aliases I use (because I'm lazy)

I’ve used Git for over a decade, but it doesn’t matter. Every single time I read a post like this one where somebody shares their aliases/shortcuts/etc, I pick up something new. Every. Single. Time.

What’s fun about this post is Victor also does the math to see if he’s actually saving himself time with all these aliases.

Assuming I type ~100 Git commands in an average 8-hour workday, that’s 550 characters saved, which converts to about one minute saved per day

That isn’t much time saved, but it still feels good, and that counts for something!

Jay Phelps github.com

git-blame-someone-else

This changes not only who authored the commit but the listed commiter as well. It also is something I wrote as a joke, so please don’t run this against your production repo and complain if this script deletes everything.

Alias this to git-take-the-credit so you can put your name on that awesome commit your co-worker made the other day. 😜

git-blame-someone-else

Git github.com

A tool to monitor Git repos and automatically pull & push changes

gitomatic <path>

2019/08/03 00:16:48 Checking repository: /tmp/gitomatic-test/
2019/08/03 00:16:48 Pulling changes...
2019/08/03 00:16:49 New file detected: hello_world.txt
2019/08/03 00:16:49 Adding file to work-tree: hello_world.txt
2019/08/03 00:16:49 Creating commit: Add hello_world.txt.
2019/08/03 00:16:49 Pushing changes...
2019/08/03 00:16:53 Sleeping until next check in 10s...
2019/08/03 00:17:03 Checking repository: /tmp/gitomatic-test/
2019/08/03 00:17:03 Pulling changes...
2019/08/03 00:17:07 Deleted file detected: hello_world.txt
2019/08/03 00:17:07 Removing file from work-tree: hello_world.txt
2019/08/03 00:17:07 Creating commit: Remove hello_world.txt.
2019/08/03 00:17:07 Pushing changes...

Git lukasmestan.com

Git quick statistics

Any git repository contains a tonne of information about commits, contributors, and files. Extracting this information is not always trivial, mostly because of a gadzillion options to a gadzillion git commands – I don’t think there is a single person alive who knows them all. Probably not even Linus Torvalds himself :)

Truth. Clone the repo here and make install or brew install git-quick-stats if you’re on macOS.

Git quick statistics

Ire Aderinokun bitsofcode

Git aliases for lazy developers

Ire Aderinokun on her blog bitsofcode:

I prefer to interface with git via the command line, at least for the simple commands. However, I’m a bit lazy, and don’t like having to repeatedly type out the same long commands multiple times a day. Over the years, I have created some short aliases that allow me to more quickly use git via the command line.

Creating aliases for common commands is definitely the way to go. I do something similar in my dotfiles, except I categorize aliases by the language or technology.

Drew Devault drewdevault.com

sr.ht, the hacker’s forge, now open for public alpha

Drew Devault, announcing “sir hat” (or however you want to refer to it)

For those who are new, let me explain what makes sr.ht special. It provides many of the trimmings you’re used to from sites like GitHub, Gitlab, BitBucket, and so on, including git repository hosting, bug tracking software, CI, wikis, and so on. However, the sr.ht model is different from these projects - where many forges attempt to replicate GitHub’s success with a thinly veiled clone of the GitHub UI and workflow, sr.ht is fundamentally different in its approach.

This has folks pretty excited. But what’s all the hubbub about? Well, in addition to being 100% free and open source…

sr.ht is special because it’s extremely modular and flexible, designed with interoperability with the rest of the ecosystem in mind. On top of that, sr.ht is one of the most lightweight websites on the internet, with the average page weighing less than 10 KiB, with no tracking and no JavaScript.

The flagship product from the software suite is it’s CI platform, which:

is easily the most capable continuous integration system available today. It’s so powerful that I’ve been working with multiple Linux distributions on bringing them onboard because it’s the only platform which can scale to the automation needs of an entire Linux distribution.

There’s always a potential for hyperbole when the creator is describing their creation, but I’m convinced this is at the very least worth checking out. It might even make for a great episode of The Changelog

Git github.com

LiteTree – a modification of the SQLite engine to support git-like branching

Imagine being able to have many connections to the same database, each one reading a separate branch or commit at the same time. Or even writing to separate branches.

This is a good idea and a testament to the versatility of SQLite. Click through to read how it works and how they’ve managed to 2x the performance of SQLite on Linux and macOS.

Phil Nash philna.sh

Git commands to keep a fork up to date

Phil Nash shared this helpful flow to keep your forks up to date. Most folks can get by with branch, checkout, add, commit, pull and push, but…

…what if you want to fork and contribute to an open source project on GitHub, GitLab or BitBucket? You’re going to need a few more commands so that you can keep your fork up to date, namely remote, fetch and merge. Let’s see how they are used…

Without Boats boats.gitlab.io

I sign my git commits with bpb (not pgp or gpg)

Right now, the only way to sign your git commits is to use PGP signatures (this is all git is able to integrate with). After a less than desirable experience using GPG, without wrote bpb in Rust to replace GPG.

I’ve been taking steps toward trying to sign and verify the data in the repo’s index without shipping a copy of GPG with Rust to every user.

This means I need to implement enough of the PGP protocol to create signatures and public keys that git will accept as valid. I’ve done this in a library which I’ve named pbp, this stands for Pretty Bad Protocol.

This library implements parsing and generation for a small subset of the PGP protocol…

Drew Devault drewdevault.com

Git is already federated & decentralized

In the wake of Microsoft’s acquisition of GitHub, the murmurs of replacing GitHub with something decentralized have been getting louder. In this article, Drew Devault points out that email-based git workflows are A Thing and one that works quite well.

In particular, this blog post is a direct response to forge-net (formerly known as GitPub). They want to federate and decentralize git using ActivityPub, the same technology leveraged by Mastodon and PeerTube. But get this: git is already federated and decentralized!

Drew has skin in the game via his sr.ht platform, and intends to make git send-email support a first-class citizen on it. Lots of interesting ideas at play here.

After all these years is email still the web’s killer app?

0:00 / 0:00