6 ms·
I'm a somewhat advanced user of Git. My coworkers use me as a reference when they have a problem of a difficult merge to solve. I don't follow each Git release
by neves 6y ago
I'm a somewhat advanced user of Git. My coworkers use me as a reference when they have a problem of a difficult merge to solve.
I don't follow each Git release, but I also didn't notice a great productivity enhancement for a long time. Sure it is a sign of a mature project, but I'd like to know:
What's the somewhat recent Git feature that you really improved your productivity?
- UkiahSmith 6y agogit restore
- mpawelski 6y ago+1 this. It's not just better name for doing "git checkout -- path". "git checkout" has this stupid behavior of restoring files to worktree and index. "git restore" by default doesn't touch index (I wrote SO answer that explains this a bit more: https://stackoverflow.com/a/60855504/350384 https://stackoverflow.com/a/60855504/350384) there is also "git switch" but I just kept using "git checkout" because there is nothing "git switch" can do that "git checkout" can (it's just a shorter name but I had aliased "checkout" to "ch" anyway, as many people do)
- jacobparker 6y agoFor the past few years the performance work (e.g. commit graph) has made a huge difference for large/fast moving repos. They're big enough to be productivity enhancements for some people: when we merged our Android-like multi-repo setup into a proper mono-repo we required updating git because things like git status/git commit/git log could take minutes without the recent perf fixes. It pays to follow the release notes because some of these features are opt-in (e.g. commit graph is still optional). The sparse checkout stuff is great but still too low-level for us to use, but it's laying the groundwork for something good.
- mbakke 6y agoAs someone doing lots of merges in a big and active project, git rerere has saved me hours whenever I need to redo a complicated merge. It's not at all new according to a quick grep of RelNotes, but I only recently discovered it, so it is new to me.
- acdha 6y agoConversely, I hit that years ago (long-running migration tarpit) and forgot about it until I setup a clean home directory on a system which didn’t have my dotfiles repo and thought I’d hit a major Git regression. It saves you time on exactly where you need it the most.
- merb 6y agogit switch/git switch -c so much better than git checkout and the confusing switches.
- imron 6y agoNot for me. Those confusing switches are already ingrained in my memory (or hidden away behind aliases) and now I find it more confusing that git is recommending new and different commands to do things that I've been doing a fixed way for years. `git restore <file>` instead of `git checkout -- <file>`is another one.
- nitemice 6y agoWell, I guess the good thing here is that they're not going to remove the old checkout behaviour. And these new commands are much easier to use and understand for a beginner.
- merb 6y agowell git checkout basically is confusing because it does two things at once. git restore and git switch basically tries to seperate the functionality. i.e. from: "git-checkout - Switch branches or restore working tree files" to - "git-switch - Switch branches" - "git-restore - Restore working tree files" tbf I found it really stupid from the beginning that it tries two things at once.
- mklein994 6y agogit range-diff Very useful to get an overview of what changed after a rebase. https://git-scm.com/docs/git-range-diff https://git-scm.com/docs/git-range-diff
- setpatchaddress 6y agogit worktree. Godsend if you regularly need to work on multiple branches simultaneously.
- jayd16 6y agoWhat does worktree provide that a fresh local clone doesn't?
- fiddlerwoaroof 6y agoReduced disk space usage for large repositories. And a convenient way to manage all your clones
- jayd16 6y agoI guess it reduces duplicating the history? Large files are by far the bulk of what I personally deal with so it don't think there's a real difference for me but I could see it helping.
- fiddlerwoaroof 6y agoYeah, it only stores the objects in the .git directory once.
- MarkSweep 6y agoIf it's a multi-gigabyte repo that you are cloning over a slow VPN, it speeds things up quite a bit.
- mklein994 6y agogit diff --color-moved This makes git diff highlight reindented or moved lines differently. I use it to get diffs similar to when you pass -w, but with a bit more context. It takes a bit of experimenting to keep it from looking like a fruit salad, but sometimes you get interesting results. https://git-scm.com/docs/git-diff#Documentation/git-diff.txt---color-movedltmodegt https://git-scm.com/docs/git-diff#Documentation/git-diff.txt...
- square_usual 6y agoIf you use git diffs frequently, I recommend setting up delta: https://github.com/dandavison/delta https://github.com/dandavison/delta
- Myrmornis 6y agoAnd I am working on implementing color-moved support https://github.com/dandavison/delta/issues/72 https://github.com/dandavison/delta/issues/72
- SomaticPirate 6y agoSetting up watchman as a Git hook for fsmonitor. It speeds up git status on large codebases https://github.com/git/git/blob/master/templates/hooks--fsmonitor-watchman.sample https://github.com/git/git/blob/master/templates/hooks--fsmo...
- kakawait 6y agoSparkle/partial checkout for big repo or legacy or people doing shit with git