Git Icon

Git

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

Zach Musgrave dolthub.com

The wordcel's guide to git

If you’re better with words than you are with shapes, this git guide by Zach Musgrave may help you get out of the ā€œI memorized N git commands but I have no idea how any of this worksā€ phase.

Here’s how Zach describes it:

The git commit graph and its relationship to common git workflows explained using simple English and easy to understand diagrams. Also some jokes.

Gustav Westling westling.dev

Introducing the extremely linear git history

An interesting idea from Gustav Westling…

One of the things that I like to do in my projects, is to make the git history as linear as possible.

Usually this means to rebase commits onto the main branch, but it can also mean to only allow merges in one direction, from feature branches into main, never the other way around. It kind of depends on the project.

Today I’m taking this one step further, and I’m introducing a new concept: extremely linear git history.

With our extremely linear history, the first commit in a repo hash a hash that starts with 0000000, the second commit is 0000001, the third is 0000002, and so on!

How he accomplishes this is perhaps even more interesting (and hacky!)

Introducing the extremely linear git history

GitLab Icon GitLab

Take advantage of git rebase

This is a solid primer on git rebase and the many ways it’s useful.

In Git, a rebase is a very versatile and useful tool to rework commits. Use it to achieve a workflow with high-quality changes proposed in high-quality commits and merge requests. It makes your developers and reviewers more efficient. Code reviews and debugging also become easier and more effective.

Git github.com

A fast terminal UI for Git

Here’s the motivation behind this Rust-based TUI:

I do most of my git work in a terminal but I frequently found myself using git GUIs for some use-cases like: index, commit, diff, stash, blame and log.

Unfortunately popular git GUIs all fail on giant repositories or become unresponsive and unusable.

GitUI provides you with the user experience and comfort of a git GUI but right in your terminal while being portable, fast, free and open source.

A fast terminal UI for Git

GitHub github.com

HUBFS – a file system for GitHub

HUBFS is a file system for GitHub and Git. Git repositories and their contents are represented as regular directories and files and are accessible by any application, without the application having any knowledge that it is really accessing a remote Git repository. The repositories are writable and allow editing files and running build operations.

So if you hubfs mnt (on macOS/Linux), it will set up a file hierarchy inside /mnt that follows this pattern: / owner / repository / ref / path. Cool idea! It is affected by GitHub’s API rate limiting and I’m not sure if/how it syncs (commits) back to the remote repos…

Git github.com

A Git-compatible DVCS that is both simple and powerful

Jujutsu (jj at your CLI) combines features from popular distributed version controls systems (Git, Mercurial, Darcs) with features not found in any of them, such as:

  • working-copy-as-commit
  • undo functionality
  • automatic rebase
  • safe replication via rsync/Dropbox/etc

And since it’s Git-compatible, adoption should be a breeze.

Jujutsu has two backends. One of them is a Git backend (the other is a native one). This lets you use Jujutsu as an alternative interface to Git. The commits you create will look like regular Git commits. You can always switch back to Git.

I’ve often wondered what will come next after Git. I’m not saying this is that thing, but it’s cool to see people working on the problem.

Git render.com

Git organized: a better git flow

Imagine this: you’ve been paged to investigate a production incident, and after some digging, you identify the commit with the breaking code. You decide to revert the change:

git revert 1a2b3c

Unfortunately, in doing so, a new bug is introduced! As it turns out, hidden in that old ā€œbrokenā€ commit was some code that another part of the app depended upon, and when you reverted those lines, it left the site once again in a broken state. šŸ™ƒ Oh dear.

How can situations like this be avoided? To answer this question, we first need to examine how these types of commits come to be.

If you’ve never heard of or used git reset… this article is a must-read.

Git github.com

Dura is a background process that watches your Git repos

If you ever get into an ā€œoh snap!ā€ situation where you think you just lost days of work, checkout a dura branch and recover.

Without dura, you use Ctrl-Z in your editor to get back to a good state. That’s so 2021. Computers crash and Ctrl-Z only works on files independently. Dura snapshots changes across the entire repository as-you-go, so you can revert to ā€œ4 hours agoā€ instead of ā€œhit Ctrl-Z like 40 times or whateverā€. Finally, some sanity.

This sounds a lot like how Fossil works out of the box, except maybe even more paranoid because Fossil will propagate every commit whereas Dura propagates all changes even before they’re committed.

The New Stack Icon The New Stack

Wait, do we need to hold up on GitOps?

Eric Gregory asks (and answers) himself a question on The New Stack:

For years now, blogs, webinars and white papers have opined that GitOps is the Next Big Thing, yet here a respected voice in the field is saying to tread carefully. So what gives? Do we need to pump the brakes? Is GitOps just a lot of unwarranted hype? Or is there a missing piece of the puzzle here? As in so many things, the answer is: It’s complicated. GitOps can be transformative for some teams, but it’s not a one-size-fits-all solution.

Git maryrosecook.com

Git from the inside out

This essay from Mary Rose Cook explains how Git works. Who should read this? Anyone who wants a deeper understanding of Git.

The essay assumes you understand Git well enough to use it to version control your projects. It focuses on the graph structure that underpins Git and the way the properties of this graph dictate Git’s behavior. Looking at fundamentals, you build your mental model on the truth rather than on hypotheses constructed from evidence gathered while experimenting with the API. This truer model gives you a better understanding of what Git has done, what it is doing, and what it will do.

(If you’d rather absorb the same information as a talk, you can watch this video instead.)

Git blog.waleedkhan.name

Lightning-fast rebases with `git move`

How much faster is it? See Timing. If the branch is currently checked out, then 10x is a reasonable estimate. If the branch is not checked out, then it’s even faster.

Is performance the only added feature? git move also offers several other quality-of-life improvements over git rebase. For example, it can move entire subtrees, not just branches. See the git move documentation for more information.

git move is part of the git-branchless suite. Cool stuff.

Daniel Janus blog.danieljanus.pl

Things I wish Git had: Commit groups

Commit groups sounds interesting to me. Anyone reading this familiar with Git innards? Is this doable?

You know the ā€œgroupā€ facility of vector graphics programs? You draw a couple of shapes, you group them together, and then you can apply transformations to the entire group at once, operating on it as if it were an atomic thing. But when need arises, you can ā€œungroupā€ it and look deeper.

I’d love to see that same idea applied to Git commits. In Git, a commit group might just be a named and annotated range of commits: feature-a might be the same as 5d64b71..3db02d3. Every Git command that currently accepts commit ranges could accept group names. I envision groups to have descriptions, so that git log, git blame, etc could take –grouped or –ungrouped options and act appropriately.

Player art
  0:00 / 0:00