Live data from Hacker News

Git tips and tricks

blog.gitbutler.com

11–20 of 143 posts

Re: Git tips and tricks

#11
post #2

Heya, author here. I have to admit that I learned a lot of these things fairly recently. The large repository stuff has been added into core piece by piece by Microsoft and GitHub over the last few years, it's hard to actually find one place that describes everything they've done. Hope it's helpful. I've also had some fun conversations with the Mercurial guys about this. They've recently started writing some Hg inter…

I wrote this and wish more people followed this specific git advice:

https://mergebase.com/blog/doing-git-pull-wrong/

TLDR: don’t be afraid of rewriting history but ALWAYS do “git pull -r —autosquash “

Re: Git tips and tricks

#12
post #2

Heya, author here. I have to admit that I learned a lot of these things fairly recently. The large repository stuff has been added into core piece by piece by Microsoft and GitHub over the last few years, it's hard to actually find one place that describes everything they've done. Hope it's helpful. I've also had some fun conversations with the Mercurial guys about this. They've recently started writing some Hg inter…

I just wanted to say thanks for the entertaining talk you gave at FOSDEM and also that I appreciated the Sneakers reference :)

Re: Git tips and tricks

#13
post #12
post #2

Heya, author here. I have to admit that I learned a lot of these things fairly recently. The large repository stuff has been added into core piece by piece by Microsoft and GitHub over the last few years, it's hard to actually find one place that describes everything they've done. Hope it's helpful. I've also had some fun conversations with the Mercurial guys about this. They've recently started writing some Hg inter…

I just wanted to say thanks for the entertaining talk you gave at FOSDEM and also that I appreciated the Sneakers reference :)

Ha! Yeah, I was wondering if anyone would catch that. I thought I heard a snicker or two in the audience, but I couldn't be sure.

Re: Git tips and tricks

#14
post #10

Yesterday I was actually trying to find out which are the top 10 files which were having most of the modifications after they were created and I stumbled upon https://github.com/tj/git-extras/blob/main/Commands.md Some great extra git command are there.

Yeah, git-extras are great. Another cool one is "git absorb":

https://github.com/tummychow/git-absorb

Re: Git tips and tricks

#15
post #9
post #3

I do not want to learn git tricks. I just wanna use it as simple as possible. Just let me push my code and be done with git and keep on working. Kudos to all who love git, for me, it's just a tool I have to use.

A part of Git's complexity is due to the fact that it was originally meant to be just the plumbing. It was expected that more user-friendly porcelain would be written on top of the git data model. Perhaps that is still the best bet at having a simple and consistent UI. Jujutsu and Got (game of trees) are possible examples.

That's a bold statement. Any proof or article where Linus states that?

Re: Git tips and tricks

#16
post #15
post #9

Earlier quoted context omitted.

A part of Git's complexity is due to the fact that it was originally meant to be just the plumbing. It was expected that more user-friendly porcelain would be written on top of the git data model. Perhaps that is still the best bet at having a simple and consistent UI. Jujutsu and Got (game of trees) are possible examples.

That's a bold statement. Any proof or article where Linus states that?

If you mean the plumbing part, I recalled it from memory. I don't have anything from Linus to back this up. But have a look at this from the Pro-Git book [1]:

> But because Git was initially a toolkit for a version control system rather than a full user-friendly VCS, it has a number of subcommands that do low-level work and were designed to be chained together UNIX-style or called from scripts.

Note that its author (schacon) is also the author of the article and is replying in this discussion thread.

I also remember reading somewhere that this design was the reason for the complexity in the porcelain. Will update if I find a reference.

[1] https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Po...

Re: Git tips and tricks

#17
post #9
post #3

I do not want to learn git tricks. I just wanna use it as simple as possible. Just let me push my code and be done with git and keep on working. Kudos to all who love git, for me, it's just a tool I have to use.

A part of Git's complexity is due to the fact that it was originally meant to be just the plumbing. It was expected that more user-friendly porcelain would be written on top of the git data model. Perhaps that is still the best bet at having a simple and consistent UI. Jujutsu and Got (game of trees) are possible examples.

>originally meant to just the plumbing

this describes all of unix. as soon as scripts were allowed to use commands, those commands could never be changed. lest we have a nerd riot on our hands

Re: Git tips and tricks

#18
post #2

Heya, author here. I have to admit that I learned a lot of these things fairly recently. The large repository stuff has been added into core piece by piece by Microsoft and GitHub over the last few years, it's hard to actually find one place that describes everything they've done. Hope it's helpful. I've also had some fun conversations with the Mercurial guys about this. They've recently started writing some Hg inter…

Thank you for your writing on Git over the years, particularly Pro Git, which is helpful.

Re: Git tips and tricks

#19
post #16
post #15

Earlier quoted context omitted.

That's a bold statement. Any proof or article where Linus states that?

If you mean the plumbing part, I recalled it from memory. I don't have anything from Linus to back this up. But have a look at this from the Pro-Git book [1]: > But because Git was initially a toolkit for a version control system rather than a full user-friendly VCS, it has a number of subcommands that do low-level work and were designed to be chained together UNIX-style or called from scripts. Note that its author (…

Boy, I can't find this either (but also, the kernel mailing list is _really_ difficult to search). I really remember Linus saying something like "it's not a real SCM, but maybe someone could build one on top of it someday" or something like that, but I cannot figure out how to find that.

You _can_ see, though, that in his first README, he refers to what he's building as not a "real SCM":

https://github.com/git/git/commit/e83c5163316f89bfbde7d9ab23...

Re: Git tips and tricks

#20
post #3

I do not want to learn git tricks. I just wanna use it as simple as possible. Just let me push my code and be done with git and keep on working. Kudos to all who love git, for me, it's just a tool I have to use.

Honestly, get outside of commit and pull and my brain feels dread like regular expressions.

Hopefully the incantation is on the Cheat Sheet and I don't make it worse.

Post reply on HN