So You Think You Know Git - FOSDEM 2024

GitButler
8 Feb 202447:00

Summary

TLDRScott Chacon, GitHub co-founder and Git expert, shares his insights on helpful Git configurations, old and new Git features, working with large repositories, and recent GitHub developments in this technical talk. Touching on handy commands like blame and log for debugging, useful options like force-with-lease for safer force pushing, Microsoft's optimizations for huge repos, and GitHub's merge request workflows, Chacon arms the audience with tips to enhance their workflows regardless of their Git proficiency level.

Takeaways

  • ๐Ÿ˜€ Scott Chacon, GitHub co-founder, gave a technical Git talk with tips and tricks
  • ๐Ÿ“ Shared helpful Git config tips like aliases and conditional includes
  • ๐Ÿ’ก Covered useful but lesser-known Git commands like blame ranges and reflog
  • ๐Ÿ” Discussed capabilities for handling large, complex repos introduced by Microsoft
  • ๐Ÿš€ Talked about new Git features like commit signing via SSH and maintenance commands
  • โœจ Demonstrated virtual branches in GitButler for advanced concurrent workflow
  • ๐Ÿค GitHub allows enforcing team workflow rules around merging and commit signing
  • ๐Ÿ“ˆ Auto-merge and merge queues help streamline collaborating on GitHub pull requests
  • ๐Ÿ•ต๏ธ GitHub exposes pull request refs that can be fetched like remote branches
  • ๐Ÿป Overall, shared advice from his 15+ years using Git aimed at making workflows smoother

Q & A

  • What is the difference between 'git blame' and 'git blame -w -C -C'?

    -The default 'git blame' command shows who last modified each line of a file. 'git blame -w -C -C' ignores whitespace changes and detects code movement, so it tracks code authorship more accurately if code has been reorganized.

  • How can you view the commit history for a specific function using Git?

    -You can use 'git log -L<function name>' to show the commit history for the code block containing the specified function. Or you can specify a line range with 'git log <path>:<start>:<end>'.

  • What is 'git reflog' useful for?

    -'git reflog' shows a log of all repository reference updates, so you can use it to find "lost" commits after doing risky operations like resetting or rebasing. It allows you to get back to a previous state.

  • What benefits does 'git maintenance' provide?

    -'git maintenance' runs background tasks to optimize repository performance, including commit graph generation, loose object collection, and incremental repacking. It speeds up operations without any active effort.

  • How can you speed up 'git status' on an enormous repository?

    -Enable the file system monitor with 'core.fsMonitor' so Git uses a daemon to watch for file system changes instead of having to stat every single file on each status command.

  • What is 'force with lease' in Git?

    -'git push --force-with-lease' does a safer force push by first checking that the remote reference matches the expected value, avoiding overwriting commits that have been added remotely in the meantime.

  • How can you sign Git commits with SSH instead of GPG?

    -Recent versions of Git allow SSH-based commit signing. You can configure this by setting 'commit.gpgsign' to point at your public SSH key instead of a GPG key.

  • What are some advantages of partial cloning?

    -Partial cloning allows filtering out file contents to make an initial clone much faster for enormous repositories. Needed data can be downloaded on-demand later, although some operations become slower.

  • What merge types can you enforce on GitHub?

    -GitHub repository settings allow enforcing requirements like only allowing merge commits, only rebasing, squash merging, signed commits, and more. This helps teams establish consistent workflows.

  • How can you access open pull requests locally?

    -GitHub advertises refs for every open pull request that you can fetch directly without adding remotes. This allows checking them out and merging locally.

Outlines

00:00

๐ŸŽค Introduction and Background

Scott Chacon, co-founder of GitHub, introduces himself at Fosdem, setting the stage for a technical talk on Git. Despite the large audience suggesting a keynote, Chacon clarifies the focus will be technical, discussing Git's evolution and his involvement. He highlights his contribution to the Git community through his book 'Pro Git' and the development of a new Git client, GitButler. The talk aims to refresh knowledge on Git, introduce new features, and share insights on Git's ongoing development.

05:01

๐Ÿ”ง Exploring Git's Capabilities

Chacon delves into practical Git usage, starting with configurations for a more efficient workflow. He offers insights into aliases for common Git commands, enhancing ease of use. The discussion transitions to 'oldies but goodies', focusing on lesser-known, yet powerful Git commands and options for enhancing productivity and understanding Git's handling of data. Through examples, Chacon demonstrates how these commands can significantly impact the Git experience, especially in terms of data interrogation and manipulation.

10:01

๐Ÿ‘“ Advanced Git Insights

The talk progresses to more advanced Git topics, including the usage of 'Git blame' and 'Git log' for detailed code investigation. Chacon introduces commands that allow for a granular analysis of changes and contributions within a repository, emphasizing the utility of these tools in understanding code evolution and responsibility. He also covers options to refine 'Git blame' output, showcasing how to bypass cosmetic changes to identify substantial contributions accurately.

15:02

๐Ÿ› ๏ธ Enhancing Git Workflow

Further enhancing Git workflows, Chacon discusses strategies for resolving merge conflicts with 'reuse recorded resolution' and introduces new Git commands for organizing and reviewing branches efficiently. The section covers practical tips for making the Git experience smoother and more productive, including the 'force with lease' option for safer remote updates and SSH keys for commit signing, offering alternatives to GPG keys.

20:03

๐Ÿš€ Git for Large Projects

Addressing challenges in large-scale Git repositories, Chacon shares Microsoft's contributions to Git for handling massive projects, like Windows. He introduces tools and techniques, such as Scalar and Git maintenance tasks, designed to improve performance and manageability in large repositories. This part emphasizes the importance of prefetching, commit graphs, and file system monitoring in maintaining efficiency and speed in Git operations for large projects.

25:03

๐ŸŒ Strategies for Large Repos and Mono Repos

Exploring further into large and monolithic repositories, Chacon discusses the tools and strategies Microsoft developed for managing such projects efficiently. He covers prefetching, commit graph generation, and file system monitoring, all aimed at optimizing Git's performance for enormous codebases. The talk also touches on partial cloning and sparse checkouts as solutions for dealing with large repositories, reducing the overhead of data management and streamlining workflow.

30:03

๐Ÿ’ก GitHub Innovations and GitButler

Chacon transitions to discussing recent GitHub innovations and his work on GitButler. He highlights GitHub's new features, such as auto-merging and merge queues, designed to streamline project management. Chacon introduces GitButler's virtual branches concept, allowing simultaneous work on multiple branches, illustrating his vision for more flexible Git workflows. He also addresses audience questions on range diffs, submodules, and SSH signing, providing insights into Git's complexities and potential improvements.

35:04

๐Ÿค” Audience Q&A and Final Thoughts

In the closing segment, Chacon engages with the audience, addressing questions on Git's design choices, such as the default behavior of 'force push' and the potential for improving submodule handling. He reflects on the direction of Git development, advocating for features that allow working on multiple branches simultaneously and automatic work recording. Chacon's responses underscore the evolving nature of Git and its adaptation to modern development workflows.

Mindmap

Keywords

๐Ÿ’กGit

Git is an open source distributed version control system that is used to track changes in source code during software development. It is one of the core topics of the video, as the speaker provides various tips and tricks for using Git more effectively.

๐Ÿ’กGitHub

GitHub is a web-based platform for hosting Git repositories. It allows developers to collaborate on open source projects by providing tools for managing Git workflows. The speaker mentions how GitHub has introduced new features related to pull requests and merge strategies.

๐Ÿ’กCommit

A commit in Git captures a snapshot of the project's files at a point in time. Commits are central to Git's version control capabilities. The video discusses commit signing using GPG and SSH, auto-merging commits in GitHub, and optimizations like commit graphs.

๐Ÿ’กBranch

Branches represent independent lines of development in a Git repository. The speaker highlights useful commands like 'git branch --column' to view branches visually and 'git branch --sort' to customize branch sorting.

๐Ÿ’กMerge

Merging takes changes from one branch and integrates them into another branch. The video covers merge strategies like rebasing vs merging, configuring allowed merge types on GitHub, and resolving merge conflicts.

๐Ÿ’กFetch

Fetching in Git retrieves the latest changes from a remote repository but does not alter the local state. Optimizations like background prefetching and commit graphs speed up fetches.

๐Ÿ’กPush

Pushing sends local Git commits to a remote repository like GitHub and updates the remote references. The video discusses 'git push --force-with-lease' for safer force pushing.

๐Ÿ’กSparse Checkout

Sparse checkouts allow cloning only specific subdirectories from a repository instead of the entire repo. This optimizes working with massive mono-repos containing millions of files.

๐Ÿ’กAlias

Aliases set up shortcut commands in Git by mapping a word like 'st' to 'git status'. The speaker recommends aliases to save typing for frequent Git operations.

๐Ÿ’กMaintenance

Git maintenance automates background tasks like loose object collection and repacking. Running 'git maintenance start' makes many Git operations faster over time.

Highlights

Git has around 40 core commands that are commonly used, with many additional niche or legacy commands

Git blame has options to ignore whitespace changes or code movement when blaming lines to see the original author

Git log can filter history based on a file path or function name to only show relevant commits

The reflog tracks every change to HEAD, allowing you to revisit any previous state even after destructive operations like reset

The 'rerere' feature can automatically record and reuse merge conflict resolutions to save effort during rebasing workflows

Recent options like '--column' improve Git branch's default output formatting for better visualization

Force with lease performs a safer force push by first verifying the remote history before allowing overwrites

SSH commit signing provides an alternative to GPG that can integrate with GitHub's verification UI

Git maintenance handles background tasks like garbage collection to keep repositories optimized

The commit graph caches relationships between commits to enable fast log operations in huge repositories

The file system monitor tracks working directory changes in the background to speed up status checks

Partial cloning allows selectively downloading commits/trees or individual directories from enormous repositories

GitHub now allows enforcing team standards around merging, commit signing, and more

GitHub exposes pull request branches as remote references that can be fetched/merged without added remotes

Virtual branches allow working on multiple lines of work simultaneously without constant switching or stashing

Transcripts

play00:28

How is our name,

play00:29

uh last name pronounced?

play00:31

Chacon. Chacon?

play00:32

Yeah.

play00:33

Okay.

play00:41

Boy, the pressure is on now.

play00:42

I really feel like I have to deliver here,

play00:43

so it's nice to have this great full house.

play00:48

Thank you all for coming out. It's great to be at Fosdem.

play00:50

So this is not I feel like this

play00:54

should be kind of a keynote type thing with this nice big audience,

play00:57

but it's really going to be a bit of a technical, you know, boring talk.

play01:01

So really, really, you know, bear with me.

play01:05

So just to introduce myself a little bit, if you don't know,

play01:09

my name is Scott Chacon.

play01:10

I was one of the co-founders of GitHub.

play01:12

I assume most of you know, GitHub at this point.

play01:15

It's been a little while.

play01:16

I used to do a lot of talks and go around and try to convince people to use Git

play01:21

and why Git was cool and now it's, you know, it's been it's

play01:24

been a while since then, but it's a very different type of talk.

play01:28

So as I've been giving talks, what I've kind of learned is that

play01:31

there are some people that have never used anything actually raise your hand.

play01:34

If you've never used anything that's not Git?

play01:38

Wow. I feel so old.

play01:45

All right.

play01:45

I also I wrote this book called Pro Git.

play01:48

So if you go to the website and you read the book there, that's my book.

play01:53

It's open source, Creative Commons license.

play01:54

So so a lot of times if you search for something on Google or something with Git

play01:58

it'll hit this, which is always embarrassing

play02:01

if I forgot something and then read about it

play02:03

in my own book that I wrote, which happens more than more than zero.

play02:07

And now I'm working on a Git client called GitButler.

play02:11

So if you're interested in that, I'll talk about it a little bit later on.

play02:13

We just opened it on GitHub, so I'll get into it a bit.

play02:17

But what I really want to go through is Git.

play02:20

So how many of you use get on the command line?

play02:24

Okay, so yeah,

play02:26

fucking nerds.

play02:27

So how

play02:32

far with it?

play02:33

I so, so how well do you know Git right.

play02:37

Actually throw out a number if you think you know

play02:41

how many commands how many Git commands actually exist.

play02:46

And somebody said 400,000.

play02:48

So there's about 145 Git commands that you can type Git something right.

play02:55

Most a lot of them are useless.

play02:57

A lot of them are not useless but are useful for scripting

play03:00

or in the background or something like that.

play03:01

There are 40 uh 82 ports on commands.

play03:04

There's 44 main ones.

play03:05

Normal stuff that you would do add, commit, push, pull, rebase,

play03:10

stuff like that.

play03:12

There's 11 manipulators, so config and ref log

play03:15

and things that you don't use that often, but kind of give you more more metadata.

play03:19

Bunch of interrogators, some inter actors.

play03:22

Most people don't use these, right?

play03:24

I mean send email you might if you're working with a mailing list with Git

play03:27

but P4 or SVN or CVS or there's a lot of CVS import,

play03:31

there's a lot of those types of things that are around almost legacy.

play03:34

There's a lot of sort of legacy stuff.

play03:36

And then there's 63 plumbing commands.

play03:39

So there's a lot of stuff like cat file and things like that that you can use.

play03:43

You can use the script a lot of times, but for the purposes of this

play03:47

talk, that's not what I'm going to be talking about.

play03:50

I'm not particularly interested in the plumbing commands.

play03:52

I'm not going to go into the the sort of nitty gritty details of Git,

play03:55

I figure if you're scripting something, if you're using LibGit 2

play03:58

or something like that, you already know most of this stuff.

play04:00

That's that's not really the point of this talk.

play04:02

The point of this talk is

play04:04

that I've started talking about Git more often with GitButler stuff.

play04:09

And I've realized that stuff that I took for granted that I thought kind of

play04:11

everybody knew because it's been around so long, a lot of people don't know.

play04:16

So this is really kind of a refresher.

play04:18

And to talk about some stuff that's that's new.

play04:20

So there's a bunch of stuff that's new

play04:23

for those of you that are more old school that have been using

play04:27

Git for a really long time, you may not pay attention to what's new in Git.

play04:30

So I want to talk a little bit about that as well.

play04:32

There's still an average of nine commits a day.

play04:35

There's 10,000 commits in the last three years.

play04:38

Do you know anything that's been introduced in Git in the last three years.

play04:41

Right. Like probably not.

play04:42

Probably most of what you've done, you learned, you know, ten years ago

play04:45

or seven years ago, whenever you started learning Git

play04:48

and you don't know a lot outside of that.

play04:49

So that's kind of the point.

play04:51

This is my friend Nick.

play04:52

He actually introduced me to Git when we worked at Reactrix together in 2005.

play04:57

So this is when Git was five months old when he had his first patch in

play05:00

and he told me about it. So Git is old enough to drink.

play05:03

Not in the United States because we're stupid, but here certainly.

play05:10

So what has changed?

play05:12

What is new, what is interesting?

play05:14

So here's our agenda.

play05:15

I'm going to talk about some helpful config stuff.

play05:17

If you don't already know, most of you probably do.

play05:19

I'm going to talk about some oldies but goodies, some stuff

play05:22

that's been around for a long time that you just may not know.

play05:24

I'll talk about some new stuff

play05:26

that's been introduced in the last few years

play05:27

that you may not have noticed crept in because there's not really a Git

play05:31

newsletter that most of you guys probably pay attention to.

play05:34

And then I'm going to talk about some big repo stuff,

play05:36

which is actually very interesting to me that most of you may not know about, but

play05:40

may not also have a need for any time soon.

play05:42

But I find it very interesting.

play05:45

And then then I'm going to talk about

play05:46

some new GitHub stuff, some stuff GitHub has introduced since I left

play05:49

that I recently kind of discovered and I find very interesting.

play05:52

So I want to make sure you know about it too.

play05:54

The style of this talk.

play05:56

I want to call a shotgun buffet so I'm just going to throw

play05:59

a bunch of stuff at you.

play06:01

Take what you might find interesting.

play06:03

If there's something that might make your daily life a little bit easier.

play06:06

A little bit better. Please.

play06:08

You know, you also don't need to take notes.

play06:10

I put these slides on our blog at GitButler, so if you go to get by the dot

play06:14

com and go to the blog, this whole slide deck is on there.

play06:17

If, if there's something you want to reference later.

play06:19

So just keep an open mind.

play06:21

Let the shotgun buffet hit you in the face and see if there's something

play06:24

interesting at the end. Right.

play06:26

So the first thing is how to configure stuff, right?

play06:30

So I'm going to give you a whole bunch of commands

play06:33

that have little options, little command flags and stuff

play06:36

that you may not know about when you learn them.

play06:38

You probably don't want to type them out of your time.

play06:40

So you probably want to do a set up

play06:41

an alias of some sort if you don't know how to do it

play06:43

or if you haven't done this type of thing before, it's fairly straightforward.

play06:46

You just say alias, dot,

play06:48

whatever you want to type, and then if you type, Git that thing.

play06:52

So if I type Git stash with two A's, it'll do stash, dash, dash all.

play06:56

I don't have to type dash dash all every time.

play06:57

So what I like to do is kind of set up a lot of things of how I like it to work,

play07:01

and I'll show you a bunch of different things.

play07:03

You might want to Alias, but that's how you do that.

play07:04

If you didn't know and dash dash global makes it so that all of your Git

play07:08

repositories have that and not just the one that you're in.

play07:10

I actually like dash dash all for stash as well.

play07:13

This is kind of a side note, but if you use dash

play07:15

and you stash something, it kind of leaves it in a weird state.

play07:19

Dash, dash, all will take away sort of all of your untracked files

play07:22

and kind of do what I thought Git stash would do by default, but doesn't.

play07:26

So just a sidenote.

play07:28

The other thing you can do is you can tell Git.

play07:31

If you say get in this case BB, you can say

play07:34

run some other script and pretend like it's a Git command, right?

play07:38

So you can script something.

play07:39

And the way you have to do that is by putting a bang at the beginning

play07:42

and then it says, okay,

play07:43

I'll give this sort of a shell prompt and I'll run it as you can even put actual

play07:46

bash scripts on the command line that way and it'll run that.

play07:50

So this is something that I put in a just a while ago

play07:53

to try to give me a better branch output that does head behind information

play07:56

and orders them by last commit and even uses the Git description,

play08:00

which most of you probably don't know that you can put a description in the branch,

play08:04

but it actually lists it out.

play08:05

Otherwise it doesn't do anything with that information, which is kind of funny.

play08:08

Okay.

play08:08

The next config thing that I'll show you

play08:10

and then and then we'll get into the really fun stuff is include.

play08:13

If so, most of you might know actually is there water around here somewhere?

play08:19

I'm going to the rate I'm speaking.

play08:23

Okay, great.

play08:25

Git config.

play08:26

So there's an include if directory directive.

play08:29

So normally how it works is you're working in your local stuff

play08:32

and you run something and it needs to say,

play08:34

okay, I'm doing the commit, what's my email address, right?

play08:36

Or should I use GPG signing or something like that?

play08:39

And normally what it does is it looks in your local .git slash config

play08:43

and then if it doesn't find a value, it backs up into your global config

play08:46

sort of .git config in your home directory.

play08:49

But what you can do is you can set up something in between, right?

play08:52

So it actually has a third place to look in between those things.

play08:55

So in this case I'm saying anything that's under the OSS directory,

play08:59

use this Git config so I can sort of overwrite

play09:01

my email address for my open source stuff

play09:03

and anything that's in the work directory, use this Git config.

play09:06

And so I can, I can say here's my, my work information for any of my work stuff,

play09:10

which is kind of nice to be able to have a little bit more flexibility.

play09:13

So if we go in here and we look at this Git config,

play09:16

I'm, I'm saying let's GPG sign stuff and use my

play09:21

other email address and if I run, user.email.

play09:24

Outside of that it says here's the email to use.

play09:25

If I run, user.email inside of that subdirectory,

play09:28

then it it changes the default, right?

play09:30

So if you want to have sort of here's all this stuff that that applies

play09:34

to everything underneath this, then go and do that.

play09:36

So that's the include if stuff.

play09:39

Okay so just the config stuff now let's go into oldies but goodies.

play09:43

I'm actually I might pull the audience a couple of times because you're all nerds

play09:48

and I really want to know who knows some of this stuff

play09:50

and who doesn't know some of this stuff because again, I'm not, I'm not.

play09:53

I've been doing this for a while and I don't always know.

play09:55

So who uses get blame? Okay,

play09:59

Who uses get blamed Dash?

play10:01

Does anybody know what that does?

play10:04

Okay, so

play10:09

it just blames a portion of the file.

play10:11

So normally you run, Git blame and it blames the entire file and pages it.

play10:14

If you know the line range, then you can say just blame this line

play10:18

range and A it makes it faster, but B, it makes it more, more understandable.

play10:22

Right. Because it's not it's not showing so much.

play10:24

And the other cool thing is that you can do exactly the same thing with Git log.

play10:29

So I don't know if anybody's ever used this, but this is super cool.

play10:31

If you know a function and you want to know

play10:33

sort of the history of that function, you can run,

play10:35

Git blame and get sort of the one liners or you can say Git log

play10:39

and give it the the the range in the path of the file

play10:42

and it'll only show you the commits that Git blame would have shown you right.

play10:46

But in order so you can kind of get a little bit

play10:48

more of a story of how that function kind of came together.

play10:54

Thank you.

play10:55

You are welcome.

play10:57

Boy, you're going to love the rest of this talk.

play11:03

The other cool thing you can do

play11:05

is you can say, Git log dash L and then give it like a function name.

play11:09

And it will try to figure out what that block is, hueristically

play11:13

and do the exact same thing.

play11:14

So if you it depends on the language.

play11:17

And I actually don't exactly know what that heuristic is,

play11:20

but you can say for example file, right it they'll say, okay, this is class file

play11:24

and so it automatically gives me the line range for that

play11:27

and just gives me the story of what that is.

play11:29

All right.

play11:29

So that is Git blame.

play11:32

The other stuff that Git blame does and that if you use a GUI

play11:36

or if you use actually GitHub and this is particularly embarrassing

play11:40

because I wrote this implementation at GitHub.

play11:42

So when I shit on GitHub for this, it is entirely on me.

play11:45

But GitHub and most of the GUIs don't ignore whitespace by default

play11:50

when when it runs Git blame and there's more options you can give Git blame.

play11:55

So you can also say dash C which says detect code movement.

play11:59

So if you delete a function and then move it somewhere else

play12:03

in the file, it will remember that and it will kind of ignore that movement.

play12:06

Right? When you when you blame that thing.

play12:09

So so it won't credit you if you move the function as owning that

play12:12

if you do it two times.

play12:14

I don't know how many people

play12:15

know about command line options where you give it multiple times

play12:18

and it does different things, but it is arguably not the best UX I've ever seen.

play12:24

And if you give it

play12:25

two times it says or the commit that created that file,

play12:28

if you give it three times it says or any commit at all.

play12:32

So it's much more expensive, but it can really help

play12:35

you get if you if you have I mean, it's not that often you're running Git blame.

play12:38

You might as well do this every time. Right.

play12:40

Because it takes more time.

play12:41

But it's much smarter about trying to ignore stuff that doesn't matter.

play12:44

So, for example,

play12:46

if we go back to this one, it looks like mostly Kiril did everything.

play12:50

If I run, Git blame dash WCCC and then give it the same thing,

play12:54

it gives me very different output. Right.

play12:56

And and importantly so because Kiril moved this at some point

play13:00

but I told it ignore that like follow all the renames

play13:04

and all the movement and it turns out that Kiril actually

play13:06

had very little to do with any of this code. Right.

play13:08

And so blame by default, a lot of times if your refactoring stuff

play13:12

will not end up with the person

play13:14

who wrote that line of code, but you can tell it to do that.

play13:17

And it's a I would set up an alias for this.

play13:21

Okay.

play13:21

And you can also see what file it was, right.

play13:24

So this file was changed multiple times

play13:26

and we can see it moving around and who edited it when it was named.

play13:29

What file.

play13:30

Okay, another one.

play13:33

Git log dash S how am I doing on time? I'm doing okay.

play13:35

Okay. Git log dash S pickax.

play13:37

So this is a way that you can say filter all my Git

play13:40

log output to anything that has this regular expression or the string in it.

play13:44

So if you removed a variable

play13:45

or added a variable, anything with that, that that string in it,

play13:49

it will just show you that this is a really nice way of seeing

play13:53

when something was changed that maybe Git grep wouldn't find because it was removed

play13:56

from the code base and you want to know when it was removed from the code base.

play14:00

The other thing is reflog.

play14:01

So this is a log of your references.

play14:03

If you haven't used this, it will do it by default on head

play14:06

and you can run Git reflog and it will show you okay, you pulled

play14:10

and you did the reset before that and you did check out from a branch

play14:14

to another one and you to rebase and here's all the steps of the rebase.

play14:17

But if you ever want to run like Git reset and you think it's going to mess stuff

play14:22

up, don't be too afraid because you can run, Git reflog

play14:25

and see kind of what every step of that was.

play14:27

And you can always get back to where you were.

play14:28

So whenever the head is pointing at something, it has a log of that.

play14:33

Another real

play14:33

small thing, and then we'll move on to new stuff, Git word diff.

play14:36

So if you run Git diff, it will give you by default a line based

play14:40

diff, which sometimes, especially if you're, you know, using tailwind

play14:44

can be really difficult to figure out.

play14:46

What was the one class that was kind of added in in the middle of this line.

play14:50

If you run Git diff --

play14:52

word diff, it will do it as a word diff instead.

play14:55

And so it makes it much easier to see if you know it's a word

play14:58

sort of a word based diff, what the difference is.

play15:01

Okay.

play15:01

And then the last one, I'm just going to say the last one because I can't remember

play15:06

how many there are is re re re, which is reuse recorded resolution.

play15:11

How many people have this turned on and know what it is. Okay.

play15:14

So the number of people don't know what it is.

play15:16

If you have a merge conflict you can tell Git remember this

play15:20

merge conflict and remember how I fixed it and keep that in memory.

play15:25

It actually keeps it on disk as a as a hash.

play15:27

But if I see it again it can automatically fix it for me.

play15:31

Right.

play15:31

So if you're rebasing stuff and you're hitting

play15:33

sort of the same merge conflicts over and over again,

play15:35

you can turn this on and you only have to fix it one time

play15:38

and every time after that that Git sees it, it will automatically fix it for you.

play15:41

And so the way you do that is by saying we re re re enabled.

play15:44

I would just turn this on.

play15:45

There's almost no reason not to do this.

play15:47

It's not super expensive disk wise.

play15:51

And when you get a merge conflict, it says, hey

play15:53

I recorded the pre image for this this conflict and when you fix it

play15:56

it says, okay, I recorded the resolution and when you get the same conflict again,

play16:01

it says, Hey, I staged this using the previous resolution.

play16:04

So I saw the same thing and I just fixed it automatically for you.

play16:06

So it's very nice of you cherry picking a lot of if you re basing a lot.

play16:11

Okay, so that's oldies but goodies that's been around in Git for-

play16:14

all of those things have been around in Git for a really long time.

play16:16

How many learned something new in that section out of curiosity?

play16:20

I can fantastic.

play16:20

Okay, so now there's some new stuff.

play16:23

So now nobody's going to know this.

play16:25

So one, there is a new option to get branch called Dash Dash column,

play16:32

which if you've ever run Git branch you'll see it

play16:35

just kind of lists them out in alphabetical order,

play16:38

which is one of my least favorite things about Git branch,

play16:40

because that's not usually what I want to see.

play16:42

But there's some new options recently that they have.

play16:46

One is column so you can do dash

play16:48

dash column or you can set a global config column.ui auto

play16:52

and then if it sees this sort of list instead of sort of paging it as one line,

play16:58

it will try to put it into columns graphically for you.

play17:01

And the other one is branch.sort.

play17:03

So you can sort your branches by default by in this case reverse commiterdate.

play17:07

So I want to see the ones that have had the last commit first

play17:11

right the most recent commit first.

play17:13

And if I run Git branch now it actually puts them in the columns for me.

play17:17

Right. So it's a little bit easier for me to kind of kind of see what this is.

play17:20

So I said this on I really like this this Git branch output much better.

play17:23

The other kind of funny thing is that there's a new git command

play17:27

called Git column that just takes input and puts it into columns.

play17:32

It literally doesn't do anything else.

play17:35

So if you want to put anything into columns now Git helps you.

play17:43

All right.

play17:43

Another show of hands who uses force with lease?

play17:46

Okay, good.

play17:47

So force with lease is the worst named and most useful option

play17:52

that I think it has.

play17:53

But I'll go through a real quick explanation of what it does.

play17:57

So this is relatively common.

play17:58

Let's say that I'm Scott and I'm working with somebody named Tom and I edit a file.

play18:03

Can you guys with that? It's okay, right?

play18:05

And I edit a file and I commit the file and I push it to the server

play18:08

and then Tom pulls from the server and he gets that file change

play18:12

and he changes the file as well

play18:14

and he commits it and he pushes it to the server. Fantastic.

play18:17

We've now collaborated, except Scott doesn't have that change yet.

play18:19

And Scott just went to lunch and had a beer and thought, You know what,

play18:23

I really mess this up. I should have done a little bit differently.

play18:26

And so he goes in and modifies the file and amends the commit.

play18:30

Right?

play18:30

Or rebase is his changes or something like that changes the history

play18:33

and he force pushes.

play18:35

Fantastic.

play18:37

So now Tom's change is gone, right?

play18:40

I just forced pushed over because I didn't think anybody had even seen that.

play18:43

In the meantime, if you rewind instead and you say force with lease,

play18:49

what it will do is it will check to see what it thought the reference was.

play18:53

And if it doesn't match, it won't push it. Right.

play18:56

Because it seems like it's stale.

play18:57

So you have to fetch first just to make sure you're up to date

play18:59

and then you can push

play19:00

if you push and it's the same, it will do the force push, right?

play19:04

As long as your reference was the last one that's on the server.

play19:07

So it's kind of a safe force push.

play19:09

So I just use this.

play19:10

If you if you do rebasing or amending or something like that, use force

play19:15

with least it's much safer than force

play19:16

and it does the same thing in the right circumstances.

play19:20

Okay.

play19:20

Another thing, I'll go through this real fast.

play19:22

Signing commits who signs commits.

play19:26

wow. you are nerds.

play19:28

Yeah.

play19:28

That nobody I know who signs like usually it's

play19:32

somebody corporate because the company kind of makes them do it or whatever.

play19:36

But who signs it with SSH instead of GPG okay, not very many.

play19:41

So there's now a new thing.

play19:43

Some people, not me, because I'm pretty smart, but other people

play19:49

have sometimes a problem getting GPG to work and kind of,

play19:54

you know, reliably and so, but all of us have SSH

play19:57

and in openness and say

play19:59

as of a couple of years ago I think they released a new feature

play20:02

where you can sign arbitrary data and get a signature out of it.

play20:07

And so that has been incorporated in Git And so now you can

play20:10

use SSH to sign your Git commits in the way that you used to.

play20:13

You can also do what GPG But it does exactly the same thing.

play20:16

So if you want to use a SSH instead of GPG,

play20:19

you can say it's actually kind of funny because it's not called signing, it's

play20:23

the GPG format is SSH and you can

play20:26

say, Here's where my public key is or here's where my signing key is.

play20:29

And then if you run, Git commit dash s.

play20:32

This is what a normal Git commit looks like.

play20:33

Although I left out the message here, if I put that in though,

play20:39

if I edit a file and I commit and I sign it and I look at what

play20:42

that that file looks like, now I have this, this GPG sig.

play20:46

Right.

play20:47

But it's actually generated from SSH But the cool thing is that GitHub

play20:50

you can upload your public key to GitHub

play20:53

or even use the same one that you push with and then GitHub mark

play20:56

it as verified or GitLab or you know, if you have your own server or whatever,

play21:01

if you could do SSH commit verification, it will verify.

play21:04

And then if I you know, I mean, this is kind of the problem with with,

play21:09

you know, why we're doing a SSH signing, right,

play21:12

is because you can put some other email address and do a commit and push it

play21:16

and then GitHub will say, Hey, this one's verified

play21:19

because I have the public key and I match it to the email address.

play21:21

This one is unverified.

play21:22

And so if you're using GitHub or GitLab, these things will work.

play21:25

But yeah, if you're signing your keys then or you're signing your commits with GPG,

play21:30

you can sign them with SSH

play21:31

and a lot of a lot of things will work that way as well.

play21:34

Um little known and nobody in this room probably will use this.

play21:38

But you can also put one guy, one guy

play21:41

in the front uses this, but you can sign your pushes as well.

play21:44

So you can sign the sort of ref updates that you push to a server.

play21:48

GitHub and GitLab do not support this, so most

play21:52

most people don't use it,

play21:54

but I think kernel.org supports it and there's a handful.

play21:58

Or if you do your own, you could do this and then you can create

play22:01

sort of like an audit log or a trust log or something like that

play22:05

that has sort of the ref, the ref updates and the and the signature.

play22:10

So that is doable, but you kind of have to run your own thing

play22:12

if you want to use that type of thing.

play22:13

The next thing is Git maintenance.

play22:17

Who use it, Who's run Git maintenance?

play22:18

man.

play22:24

All right.

play22:24

So all you have to do, everyone do this today.

play22:27

Go into whatever repository you work on the most and run Git maintenance start

play22:32

because what Git maintenance start does is it adds.

play22:36

I mean, really what it does is it does this it just adds this to your Git

play22:40

config file and it says strategy incremental.

play22:44

I'll show you what that means in a second.

play22:45

But what it really does is it adds a cron job.

play22:48

Forget to run in the background every hour, every day

play22:51

and do maintenance tasks on that repository.

play22:53

Right.

play22:54

And most of the time

play22:55

that's just going to make lots of things faster in a way that you'll never notice.

play22:59

So run it

play23:00

because it's just going to make everything faster

play23:02

and you won't have to worry about anything.

play23:04

So if you've ever run like a Git command and you see like, you know,

play23:07

it's garbage collector, it's running.

play23:09

Git GC It's like garbage

play23:10

collecting or pruning loose objects or doing something like that.

play23:13

It's doing that but in the background.

play23:14

So you don't

play23:14

it doesn't have to tack it on to another command that you run

play23:17

because there's something running in the background.

play23:18

So this is what strategy incremental does.

play23:23

It does mostly these four things.

play23:25

It does commit graph generation, which I'll talk about in a second

play23:28

pre fetch every hour, which I'll talk about in a second

play23:31

loose object collection and incremental repacks of of your packs.

play23:35

But really all that means is shit just gets faster.

play23:37

Right.

play23:38

So if you want to run it and just have it go in the background instead of after

play23:43

sequentially after you run to Git command, you can do that, Git maintenance start.

play23:47

That's all you have to do. Okay. So now

play23:51

stuff that

play23:52

I'm actually I'm curious how many people in this room

play23:55

work on a repository that is you would qualify as enormous

play24:01

by enormous would you say more than half

play24:03

a million files in your working directory?

play24:07

Okay. Okay, good.

play24:08

Then there's seven people in this audience

play24:10

that are going to find the next 20 minutes useful. So.

play24:15

So whether you like Microsoft or not, I have a little bit of a bias

play24:20

because they bought GitHub and that was nice for me. But

play24:26

whether you like them or not, they have put a ton of effort

play24:30

into large repository and monorepository supporting git

play24:34

because they moved Windows to it and Windows is enormous.

play24:38

So Windows is, you know, 3.5 million files on disk, 300 gigabytes to clone.

play24:44

Like think about starting the job and trying to clone off of a Git repos-

play24:47

like GitHub or something, 300 gigabytes.

play24:50

For reference, the Linux kernel is four and a half.

play24:53

Right?

play24:53

So it's it's it's a, it's a chore.

play24:57

And so what they did is that they put a lot of resources

play24:59

into making large repositories and monorepositories

play25:02

work relatively well in the Git ecosystem in the last five years.

play25:06

And I want to show you the tools that they did.

play25:09

So the first thing they did was they tried to do a virtual file system

play25:12

and so you wouldn't have sort of actually all of the contents of the files.

play25:16

It would just be sort of on demand and it would go to a special server

play25:20

that they had and it request sort of, you know, file contents as it needed it

play25:24

in order to do something.

play25:25

But it looked like you had all the files until you actually tried to access them

play25:28

and then it pulled them on demand and then they thought

play25:32

it's actually not necessary.

play25:33

And they created this project called Scalar and Scalar

play25:37

tried to do a lot of the things that I'm going to actually

play25:40

they did all of the things I'm going to tell you about now.

play25:42

But then over time, all of that stuff actually just got shifted into Git core.

play25:46

And so now they a scalar is just a wrapper around that in the in

play25:50

the git for windows binary

play25:51

but everything's baked into Git and you can use it on any on any system.

play25:55

So now it's just all in Git, so what is that.

play25:57

So there's a couple of things.

play25:58

One is prefetching which I talked about with Git maintenance.

play26:00

If you run Git maintenance, start every hour, your system will fetch

play26:04

from the server whatever project that you're on,

play26:07

it will not update your references, so it won't actually do what it does

play26:11

when you do a Git fetch in that origin main updates,

play26:16

but it will get all the data and it will keep the references to that data

play26:19

so that when you go and you run, Git fetch,

play26:22

that it's not getting almost any data.

play26:24

It almost always seems to me, even if you haven't fetched in three days,

play26:27

if you go and you run, Git fetch, it's going to be like, Yep, I already have

play26:31

all the data essentially in no op Here's your new reference, right?

play26:35

And so it just makes Git fetch seem fast because it's doing it every hour in

play26:38

the background all the time.

play26:40

You can look at this if you run, Git maintenance start

play26:43

and after an hour you go and you look at your references,

play26:45

you look at, you know, the sort of for-each-ref list out of the

play26:48

but you can also just list dot Git slash refs or whatever

play26:52

there's a new thing called pre fetch

play26:54

all of the Git commands ignore this very specifically so if you run Git

play26:58

log dash dash all it will just 100% pretend

play27:01

that these don't exist which it won't do for any of the refs,

play27:04

but it pulls all of them down so that it doesn't see

play27:07

any anything that it pulled down.

play27:08

And it just does it in the background.

play27:09

It just makes fetches and pulls very, very fast.

play27:12

The next thing that they do is something called commit graph,

play27:16

which also Git maintenance will run for you and will build for you.

play27:21

But let's look at an example of a large repository.

play27:24

So this is the Linux kernel.

play27:25

If I pull down the Linux kernel, it has 1.2

play27:28

million commits if I run Git log dash, dash, graph dash.

play27:32

dash graph is a little bit difficult because it has to walk all of the objects

play27:36

in order to figure out how to render even the first one.

play27:39

Right?

play27:39

So it has to walk the entire tree because it doesn't know what it's going

play27:42

to find to be able to show you sort of even the beginning of the tree.

play27:45

So it tends to take a really long time.

play27:47

It can't incrementally do it,

play27:50

but you can run, Git Git commit graph, right.

play27:53

And it takes a while, but it is incremental.

play27:56

So it's only the first time and then it can kind of add to that.

play27:59

And then you run it again and it takes almost no time.

play28:02

Right?

play28:03

Because what it's doing is it's

play28:04

sort of caching an index of all of the commit objects so that it can do commit

play28:08

operation or commit graph operations very, very fast.

play28:10

Now, you don't really want to go in and run, Git commit graph, write all the time.

play28:14

But there's two different things you can do.

play28:16

One is run the maintenance thing that I talked about,

play28:18

which will do it automatically.

play28:19

The other is this you can set this fetch, write,

play28:22

commit graph and it will write it on fetch.

play28:24

So every time you kind of get new data, it'll write the difference update

play28:28

and then all of your log operations are faster if you have a big repository.

play28:32

The next thing is file system monitor so you don't have to do untracked cache.

play28:37

That's just caching on track files.

play28:39

But first monitor, if you've ever run Git status

play28:42

in a very, very large repository like chromium or something like that,

play28:46

if you have 400, 500,000 files, it takes a really long time, right?

play28:50

Because the way that Git figures out what has changed is it stats

play28:54

every file in your working directory and that can be relatively expensive.

play28:58

So FS Monitor instead launches a daemon that looks at the file system and watches

play29:04

for inode events and updates of cache in memory that says

play29:07

this file was changed because I saw it get changed with my file system watcher.

play29:11

And so if you set that that config value, then the next time that you run Git

play29:17

status, Git will notice that the thing is running or not running.

play29:20

And if it's not running, it'll launch it.

play29:21

And the next time you run, Git status after that it'll be very fast.

play29:24

So this is a status on the chromium project,

play29:28

on a, on a bare check out, which is again 470,000 files and it takes 10 seconds.

play29:33

Right.

play29:33

So if every time you ran Git status and took 11 seconds, it'd be a little bit

play29:37

annoying if you turn this on and you run Git status again.

play29:41

It's still relatively slow, but the third time you do it, it's

play29:43

very fast because now it's just running it out of the file system.

play29:45

Watcher.

play29:46

So again, if you have a really large repository,

play29:48

you can turn on the file system. Watching

play29:51

this are

play29:51

some sort of fake statistics that GitHub did where they did synthetic

play29:55

loads of million files and 2 million files,

play29:58

and it just gets worse and worse and worse to do add and status commands.

play30:01

But with the files at the monitor, it's very fast.

play30:02

Okay. Thank you.

play30:04

And last is partial cloning.

play30:06

So if I clone the, let's say,

play30:10

the Linux repository, it takes a while because it's four and a half gigabytes.

play30:14

If I say filter, I can filter out blobs so it downloads everything except blobs.

play30:20

And so all of those are left on the server, but it downloads

play30:23

all the commits and trees and it has to do two different fetches for this.

play30:26

One is the gigabyte and a half of commits and trees, and then the other one is

play30:30

the 243 megs of the working directory blob so that it can put something in my work.

play30:34

So it just takes the data I need for the very last commit,

play30:38

but I can still run graph operations and all of that

play30:40

or I can say no trees

play30:43

and I don't know why it's blob none but tree zero.

play30:48

But you've used git for a while so you understand

play30:53

and that just doesn't bring any trees down either.

play30:55

It's relatively rare to use this except for in CI build type stuff.

play30:59

But if you want to take a really large repository and make it make it

play31:03

so that it's a relatively fast download,

play31:05

like if you're working on the Windows repository or something like that,

play31:07

what most people will do when Microsoft does is they filter out

play31:11

the blobs, they do this, this blobless one, and

play31:15

and then and then Git will automatically Git new data as it needs new data.

play31:20

Right. So it's almost like a virtual file system.

play31:22

And again, this goes down to 2 seconds instead of instead of,

play31:25

what, 40 4 minutes, four and a half minutes.

play31:28

Right.

play31:29

The bad part is that if you blame, it doesn't have all of the data

play31:34

for every blob file.

play31:35

And so it needs to fetch it on demand as you run a blame.

play31:38

So instead of a blame looking like this, it goes like this, right?

play31:42

So it just keeps pulling next versions down in order to run the blame.

play31:45

So if I look at sort of the difference of blame from Linux on the full

play31:50

check out is 4 seconds on a file and and on the blobless one is 45 seconds.

play31:54

So it does slow some stuff down and there's a lot of other stuff.

play31:57

If you're really interested in large repository stuff, there's multipack

play32:00

indexes, the reachability bitmaps, there's geometric repacking.

play32:03

GitHub has talked about a lot of this a blogged

play32:06

very well about a lot of this if you're interested in it,

play32:08

but it tends to be you have to have huge repositories.

play32:12

And then the last thing that I'll talk about in big repo is model repo stuff,

play32:15

which is sparse checkout.

play32:17

So how many use a mono repo at work or so?

play32:21

Okay. Okay. Not bad. Not bad.

play32:22

Thank you for the data. Zero.

play32:24

So sparse checkout is you can clone with no checkout

play32:28

and then say here's the directories I want and only those ones.

play32:32

Also, you can say I want a sparse index so only they go in the index.

play32:35

And if you have a ton of of subdirectories and you only really need to work

play32:40

with three of them, you can say

play32:42

give me my just my commits and my commits in my trees and none of the blobs

play32:46

and just check out these, this one directory, these five directories

play32:50

or something like that and then just grab the data as you need them.

play32:53

Right.

play32:53

And it makes really, really large repositories much, much easier.

play32:56

So another example we have Git Git status.

play33:00

It takes 5 seconds

play33:03

and I run this, Git sparse, check out and set, build and base.

play33:08

Those are the two subdirectories I want in my chromium build and then I run Git

play33:12

status and it's much, much, much faster because it's looking at much less data.

play33:15

But those are the only two that are in my working directory as well.

play33:17

And when I do commits, it looks like the rest of the data is there, right?

play33:21

Like it doesn't pull them out, but I can just work with some subsets

play33:25

and it even tells you I'm only working with 2% of my track files.

play33:28

Okay, last thing on our agenda.

play33:31

Actually, I do have one one secret thing real fast,

play33:35

but GitHub stuff.

play33:35

So there's a bunch of GitHub stuff that you may not know about.

play33:37

There's allowed merge types.

play33:39

So if you go into your GitHub settings,

play33:41

you can say I only want merge commits or I only want rebasing.

play33:45

And then you get in a conversation with your coworkers and you fight.

play33:50

And like people have actual physical arguments and you figure out

play33:53

are you a rebase shopper or you merge shop, we're having beers later.

play33:57

So if anybody wants to have that argument with me, I'm more than happy to do that

play34:01

merge.

play34:01

So and but you can also do squash merging,

play34:07

which is arguably a good sort of middle ground for this as well.

play34:10

And so all these things and then when you go and on GitHub, you can you can

play34:15

now sort of make sure that your repository sticks to that, right?

play34:18

So you can say enforce these standards when you hit the sort of merge button,

play34:23

it will only give you the options that you have allowed it to give you.

play34:26

But if you try to push, say, a merge, you can tell it

play34:29

don't accept pushes with merge, commits or you know,

play34:32

however however you actually want to do it,

play34:34

you can make GitHub enforce a lot of the stuff now, which is kind of cool.

play34:37

I actually didn't know that until recently.

play34:39

You can also auto merge.

play34:40

So if you guys ever if you turn on this this requirements

play34:44

for some sort of status and you have some CI, okay

play34:48

and you have some CI and you say allow auto merge,

play34:50

there's a button that says I will merge it as soon as it passes CI

play34:53

But it's kind of nicer than going back and checking status and merging it later.

play34:57

So I use this all the time.

play35:00

There's also a

play35:00

merge queue which if you have a lot of commits,

play35:03

will kind of stack them all together and merge them at once.

play35:06

There's a require a linear history.

play35:08

If you really like rebasing,

play35:10

you can force GitHub to not accept pushes that have merge commits in them.

play35:14

You can require signed commits which goes back to the SSH thing and so on.

play35:19

And then the last thing on GitHub is the PRs that have heads.

play35:23

So if you run Git LS remote on GitHub repository, all of your pull requests

play35:27

actually have refs that you can pull down and you can merge from.

play35:31

Most people don't know that most people think you have to add.

play35:33

Like if somebody sends you a pull request, an open source project

play35:35

that you have to add that is a remote and fetch from that and merge that in.

play35:38

But GitHub actually advertises all of these refs

play35:41

that you can pull from or fetch from directly, which is kind of cool.

play35:45

So you can put in something like,

play35:47

you know, give me all my pull requests as actual refs and then every time

play35:51

you fetch it it'll pull all of those down as local references, which is cool.

play35:55

Okay.

play35:55

And then very last thing I wanted to talk really fast about GitButler,

play35:59

which is something that, that I'm working on with my team over here, which is we

play36:03

have this new thing called virtual branches,

play36:04

so we can work on multiple branches simultaneously

play36:08

instead of having to sort of stash stuff and switch branches.

play36:11

And so you can have sort of each lane as a branch.

play36:15

So this is one branch and another branch, maybe a bug fix,

play36:17

like you're working on a feature and you see a bug fix,

play36:20

you don't have to commit it into the feature branch, right?

play36:22

You can kind of and you don't have to switch.

play36:24

You can drag it over in another lane and committed separately and each

play36:29

one can kind of go into its own PR as though that was the only thing on disk.

play36:32

But it's a very kind of nice way of working and it's open.

play36:36

So if you go to, to, to, to GitHub you can take a look

play36:41

and and see if that's something that is interesting for you.

play36:44

And that is the end of my talk.

play36:46

Thank you very much. And let's drink.

play37:00

Okay. So I wanted to have some time for Q&A.

play37:03

If there's any questions or something that I can do, there's a question over here.

play37:06

Yeah.

play37:07

So since you mentioned you do merges, I cannot help asking this.

play37:11

So what about range diff does

play37:14

GitButler does it And why does GitHub not do it.

play37:18

Why does GitHub not do Git range diff?

play37:22

so, I almost put a thing on range diff in here, but

play37:25

it's a very kind of specific workflow where you don't use it

play37:27

unless you're doing a lot of sort of rebasing series

play37:29

and you want to compare sort of a rebase series

play37:32

to another series to see if something changed.

play37:33

So yeah, if you, if you do that, check out range diff,

play37:37

I have no idea why GitHub doesn't do that except I think that

play37:42

you know, GitHub like a lot of services

play37:44

like they try to say here's what we think

play37:48

a workflow should be or what a good workflow would be.

play37:52

And they build tooling around that and try not to do everything

play37:55

that could possibly like, like every workflow that they see in order

play37:59

to try to make it less confusing for people.

play38:01

So I think it's more that people in GitHub don't use that type of workflow like,

play38:05

like at least when I was there, I can't speak for the last

play38:08

eight years or whatever,

play38:09

but like we did not do a lot of rebasing, we did a lot of merging.

play38:12

And so if you're doing merges all over the place, then you don't need

play38:15

range diff like range diff doesn't really make sense in that

play38:17

in that workflow because you're not comparing,

play38:19

you know,

play38:19

what is this this patch series compared to this patch series

play38:22

and did I miss something? Is that's my guess

play38:26

So another question.

play38:28

We've been working a lot in my team with some sub modules

play38:33

and frankly it's not a nice thing to work with.

play38:38

Google has for large project projects introduced repo,

play38:43

but is there any like work that you know of is being done on sub modules?

play38:49

Because I'm keeping track of refs of updated.

play38:53

sub modules is frankly Yeah it's a great question.

play38:57

Why do some modules suck everywhere is essentially

play39:02

the question and you know it's funny because they always have

play39:06

like I've been working on this, as I said, I've been involved

play39:10

heavily in the Git project for more than 15 years probably,

play39:13

and there's not a single even meetup of Git developers where they're like,

play39:17

We shouldn't have put sub modules in there.

play39:18

Like they it's and there's a lot of different

play39:22

I think what a lot of people are moving towards is mono repo, which is mono

play39:26

repo stuff

play39:27

where you just have

play39:27

everything in one repository so you don't have

play39:29

to worry about a lot of the things you did sub module stuff for,

play39:32

but it doesn't cover every case.

play39:34

And even actually a lot of the stuff that I talked about,

play39:36

like the sparse checkouts and the sparse index stuff I think don't work

play39:39

well if you have sub sub sub modules because just nobody uses them

play39:44

that works on on Git and so they, they don't optimize optimize anything

play39:50

but yeah I honestly don't know from from a the companies that I've talked to

play39:54

in the last couple of years most people that they care about that

play39:57

either use patch package management type stuff for that that type of problem said

play40:01

or they have them on a repo

play40:03

and they can start using some of these tooling,

play40:05

although GitHub is not good at mono repo support.

play40:07

So that that that becomes the problem now. Right.

play40:09

Like locally it's fine but now all your issues

play40:12

are in one repository and all of your you know.

play40:14

Yeah but yeah.

play40:15

Hey thanks. So is this SSH signing, is

play40:19

it possible to specify more than one key?

play40:22

Yes. Okay.

play40:23

Yeah. Yeah, you can.

play40:25

I mean, when you're signing it or verification like the keyring

play40:30

when you're signing, I mean, you have to choose a one

play40:33

to sign the commit with, if that's what you're asking.

play40:36

But you can.

play40:37

Is that what you're asking?

play40:37

I don't know what you're asking.

play40:41

Yeah. Okay.

play40:42

So my question would be why can't force was least be the default force.

play40:48

Yeah.

play40:48

I mean, the thing is why can't force at least be the default?

play40:51

It probably would be a good idea.

play40:53

Or to have the more aggressive version be the the longer option.

play40:57

I think it's more just that Git is always backward compatible, right Like that.

play41:02

That's always like, like for, for 19 years now, there's like almost nothing

play41:07

that I could do.

play41:07

I could have scripts that I wrote in in 2005.

play41:10

They would probably still work with, with, with the current version of Git.

play41:14

And it's a great thing about Git right?

play41:15

Like, it's actually very, very nice that they really don't deprecate very much

play41:20

and they make sure everything's always backward, backward compatible that

play41:23

gets into trouble.

play41:24

There's actually stuff I didn't really talk about,

play41:26

like there's like Git switch instead of check out.

play41:28

That's to just being able to switch branches and not do

play41:32

other stuff like, like a, like revert file contents and things like that.

play41:36

So they kind of add

play41:37

more to the user interface in order to try to make it less confusing.

play41:40

But then there's just now more commands that do the overlapping things.

play41:44

So but yeah, it's, it's because they don't want to be backward

play41:48

compatible on anything and they just assume

play41:50

you're going to set up aliases for new stuff. That's cool.

play41:52

I think in that case, it would be great if it would be configurable over

play41:56

kind of thing. So sorry it might be.

play42:00

I'd have to check if you go to like to get config

play42:02

man page, there's 10,000 things that you can configure.

play42:05

It might be possible.

play42:08

I don't know if you can overwrite what force does to force with

play42:11

least by default if you actually push, put it on the command line,

play42:15

but you could probably change what the default

play42:17

behavior of Git push with no option is.

play42:21

Right. But that's not usually what you want to do.

play42:23

So it may be there may not be one.

play42:25

I'd have to look or you'd have to look. Actually, you look.

play42:32

Yeah. Thanks for the talk.

play42:34

And first of all, Git squashed.

play42:36

No other options are allowed.

play42:37

But my real question is, if you're like back at the Gates

play42:42

development team, what would be the direction that you would like to

play42:45

see Git moving More like we have a lot of features for mono repos.

play42:49

What are the things that you think Git is missing?

play42:53

what a great question.

play42:54

I mean, to some degree

play42:56

I have a little bit of a cheat in that I'm writing a Git client

play42:59

and so everything that I'm putting in the Git

play43:01

client is stuff that I kind of wish Git did.

play43:03

So I would like to be able to work on more than one branch at a time

play43:06

without being able to essentially have more than one index of more than one head

play43:10

that I'm working on simultaneously. I think.

play43:12

I mean, we're building that and I find it very valuable.

play43:14

So that is one thing.

play43:15

The other would be recording everything you do

play43:19

that it's a little bit frustrating that I can lose work in Git,

play43:23

but I can't lose work in,

play43:24

you know, Google Docs or something that just records shit all that.

play43:27

Like just save a C R D T of every file all the time.

play43:30

Like, how expensive is that? Right?

play43:31

Like, it'd be kind of nice to say, show me what my working

play43:34

directory or this file or something look like on Tuesday at 10 p.m..

play43:37

Right. Like you can't do that.

play43:39

You can't Git won't save anything you don't commit really.

play43:42

Right. Or stash which is basically a commit.

play43:44

But why not?

play43:46

Like there's no there's no reason for a modern version control system.

play43:48

That's not it's not network based, It's not disk bound.

play43:51

Right. Like just save everything.

play43:53

It'd be nice to just say, watch this, like, watch this directory and make sure

play43:57

I never lose anything in it and help me Craft commits when I'm ready to share.

play44:00

So those would be two big things that we'll probably

play44:04

I mean, we've built both of those to some degree,

play44:05

but like even in core Git, I think it would be nice to have to have there's

play44:11

Git hasn't changed it was written

play44:12

for people that are that are submitting patch series the mailing list.

play44:15

Right and it's very very good at that

play44:17

and I think GitHub

play44:18

kind of bastardized that a little bit to really go towards the pull request

play44:21

rather than than talking about patch series

play44:23

and have having communications with the patch series

play44:25

which has a different set of of strengths and weaknesses.

play44:29

But like I said, it's not it's backwards compatible.

play44:32

It hasn't changed really the user interface fundamentally for,

play44:36

which is why a lot of you guys didn't know a lot of the stuff that I talked about.

play44:39

Like you, you just use the same thing all the time.

play44:42

I just use the same thing all the time. So.

play44:43

So yeah, it's, it's a little bit difficult to go

play44:46

in a massively different direction for those reasons, I think.

play44:50

But there's lots of cool stuff we could do with version control, I think.

play44:53

Okay, one more maybe.

play44:54

How much time do we have? One more.

play44:57

So we all have the command line.

play45:00

But one question.

play45:01

Do you ever use any visual tools?

play45:04

Do I use visual tools?

play45:05

So I use obviously I use GitButler.

play45:09

I've been using it for three or four months now, which I enjoy a lot.

play45:13

The from and I use, you know, Visual Studio code with VIM

play45:17

key bindings because I'm kind of a nerd, but then also not

play45:21

but I'm partial partially nerd, partially executive.

play45:25

So I have to do Visual Studio code with key bindings.

play45:28

But, but before that, I think is a more interesting question,

play45:32

which was what did I use?

play45:33

What I mean what do you guys use GUIs versus the command line I used GUIs

play45:38

always for interactive adding because I just find it much much faster

play45:42

to do interactive adding through almost any GUI than it is through

play45:45

the actual interactive ad script that Git provides.

play45:48

I would love to do rebasing more drag and droppy or something like that.

play45:52

But, you know, I can also edit the stupid script and,

play45:55

you know, put put pic and stuff all over the place.

play45:57

That's right.

play45:59

But for the most part it's interactive, adding

play46:01

that's the thing I spend a lot of time in.

play46:03

And when I do takes,

play46:04

it's worth the context which to go over to a GUI and say,

play46:07

I can make this much faster and much more specific

play46:09

than trying to go through, you know, like hit five

play46:12

to choose the next file grouping and add them and stuff like that.

play46:16

So it's really it's whatever's fastest.

play46:18

I think everybody uses the command line with Git still because not because it's

play46:22

it's the best thing that could possibly be because but because it is fast, right?

play46:26

In almost anything you do, it's faster than hitting a button

play46:29

that then calls that script. Right.

play46:31

And so I always use the command line for stuff,

play46:34

unless it's something like interactive ad, we're really having a do we add

play46:36

something to the experience in a way that makes what I'm trying to do faster?

play46:41

Okay, that's it.

play46:42

Hopefully I'll see you for drinks later.

play46:44

Thank you very, very much. It's been a pleasure. Bye.