Live data from Hacker News

Git tips and tricks

blog.gitbutler.com

71–80 of 143 posts

Re: Git tips and tricks

#72
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…

How about an RSS feed on your blog? If there's one there, it's not obvious.

https://blog.gitbutler.com/rss/

most of the time trying the main URL + /rss works

also the tag is there https://blog.gitbutler.com/rss/">

Re: Git tips and tricks

#73
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.

Why even use git then? `scp code server:code` does what you need.

This isn't a rhetorical question.

Re: Git tips and tricks

#75
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…

You probably already know these bits & bobs, but I wanted to share:

  [diff]
    external = difft
Use the fantastic difftastic instead of git's diff. https://difftastic.wilfred.me.uk/

  [alias]
    fza = "!git ls-files -m -o --exclude-standard | fzf -m --print0 | xargs -0 git add"
    gone = "!f() { git fetch --all --prune; git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D; }; f"
    root = rev-parse --show-toplevel
Those are the most used aliases in my gitconfig.

"git fza" shows a list of modified/new files in an fzf window, and you can select each file with tab plus arrow keys. When you hit enter, those files are fed into "git add". Needs fzf: https://github.com/junegunn/fzf

"git gone" removes local branches that don't exist on the remote.

"git root" prints out the root of the repo. You can alias it to "cd $(git root)", and zip back to the repo root from a deep directory structure. This one is less useful now for me since I started using zoxide to jump around. https://github.com/ajeetdsouza/zoxide

Re: Git tips and tricks

#76
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.

[deleted]

Re: Git tips and tricks

#77

Earlier quoted context omitted.

Congratulations. You just broke userspace.

You clearly have no idea what you are chattering about. The saying "Don't break userspace" is for the kernel . It has nothing to do with userspace programs potentially affecting other userspace programs.

[flagged]

Re: Git tips and tricks

#78
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.

Why even use git then? `scp code server:code` does what you need. This isn't a rhetorical question.

[deleted]

Re: Git tips and tricks

#79
post #33
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.

I understand your sentiment but git is really not all that hard. And knowing a few things that go beyond bog-standard checkout/commit/push, especially history-rewriting activities, will greatly improve quality of commit-history - which might not be of much use for you but might help other engineers working on your project to make easier sense of what's going on. And on another note, git is probably one of the longer-…

[deleted]

Re: Git tips and tricks

#80
I read (and upvote) anything git related by Scott Chacon. He was instrumental in me forming my initial understanding of the git model/flow more than 10 years ago, and I continue to understand things better by consuming the content he puts out. Thanks Scott!
Post reply on HN