Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Good list, definitely concur with the top ones and can't think of anything major to me that's not listed.

rebase.autosquash combined with an alias I have (called 'fixup') to make that commit and then do the rebase is probably my top one by an absolute long shot, at least in terms of frequency of use. pull.rebase is important to me, but I fixup so frequently, I really don't know how people get by without it.

(Well, I do, generally they create a snaking history by merging master or whatever into their own branch repeatedly, swapping the parents, and make lots of new commits to fix things in the old ones. But I don't know how you can put up with doing that to yourself, is I suppose the long version of what I mean.)

Oh - semi-missed - insteadOf is more useful than implied: I have 'gh:' mapped to the full thing, so I just `git remote add somefork gh:someforker/the-project`, for example.

Some other minor ones: advice.statusHints=false; include.path (if you need it you need it - I use it to set my signing key according to which Yubikey is plugged in, plugging can write the whole file because it's all that's in there, no parsing required); remote "origin".fetch set to get PRs; oh and interactive.singleKey = true if that was missed - not a minor one at all! Makes staging changes so much faster and easier. Obviously not as fast as `add .` or `commit -a`, but don't do that.



Another way to get that instead of behavior is with SSH configuration. I have something like this in my ssh config:

    Host github
        Hostname github.com
        User git
Then you can do a "git clone github:microsoft/windows" and you're good to go.


True. If I'm only using it for git though makes sense to keep the config there IMO. But certainly that's handy when you're sshing interactively or doing other things with that host.


This fuckin' guy.

If you've evolved an SSO solution from brownfield, or just merged with another company you can easily end up in a spot where you have 2 user names across the systems, and that's before you get into doing things like pushing bug fixes to Github straight from your work machine.

Make yourself an .ssh/config file. Set your user, and your ssh key for where it matters (I don't use the same key for ssh to servers and for talking to github or bitbucket)


Ay usually "this fucking guy" has a pejorative tone... I think you were agreeing with me but yeah not sure everyone understood the same.


The show where everything is made up, and the points don’t count.


> Make yourself an .ssh/config file. Set your user, and your ssh key for where it matters (I don't use the same key for ssh to servers and for talking to github or bitbucket)

Another good setting for your ssh config if you use different keys for different servers is to require passing a key for all hosts rather than it trying each of your keys to see which one works:

Host * IdentitiesOnly yes


Neat


I really loved the idea of fixup + rebase, but of course we didn't have an example here :)

So I spend half an hour to learn about git shell commands in aliases (had to learn the hardware that arguments require functions) and came up with the following.

fixup = "!f() { git commit --fixup ${1} && GIT_SEQUENCE_EDITOR=true git rebase --autosquash --interactive --rebase-merges \"${1}~1\"; }; f"

from https://gitlab.com/olliver/dotfiles/-/blob/master/.config/gi...

Hope this helps anybody else :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: