My git productivity hack is `git diff --color-words`. Instead of showing the line-by-line diff, it shows only the words that changed. Especially useful if you have long sentences where only a comma changed or some other typo. With git diff, the two lines are shown, with --color-words, only the changed symbol is highlighted. The option --color-words also works with git show. I even made aliases for them: git cshow and…
New in Git: switch and restore
61–70 of 550 posts
Re: New in Git: switch and restore
#62I picked up git restore with git's suggestion itself. Whenever I do git status, it tells me which files are changed and if I want to go back to their previous states, I can use got restore.
After a few month the autocomplete got updated as well and I could actually use the new interface without to much frustration.
Re: New in Git: switch and restore
#63Can someone tell me why they decided to have the new branch argument be `-c` in switch when it's `-b` in checkout?
Re: New in Git: switch and restore
#64It is ironic that Linus hates C++ so much, and then proceeds to create what is for all practical purposes, the C++ of source control systems.
Re: New in Git: switch and restore
#65Can someone tell me why they decided to have the new branch argument be `-c` in switch when it's `-b` in checkout?
Re: New in Git: switch and restore
#66It's not really new anymore, but still way underused, so it could certainly do with more attention. Git's UI has become better, but they can't really remove the old UI and tutorials using those, so people keep sticking to that.
Currently, that's an ubuntu 18.04 machine at work and that doesn't have `git restore`, yet.
Re: New in Git: switch and restore
#67It is ironic that Linus hates C++ so much, and then proceeds to create what is for all practical purposes, the C++ of source control systems.
Re: New in Git: switch and restore
#68My git productivity hack is `git diff --color-words`. Instead of showing the line-by-line diff, it shows only the words that changed. Especially useful if you have long sentences where only a comma changed or some other typo. With git diff, the two lines are shown, with --color-words, only the changed symbol is highlighted. The option --color-words also works with git show. I even made aliases for them: git cshow and…
Re: New in Git: switch and restore
#69It is unfortunate that: + git switch is documented as "EXPERIMENTAL" + git --help lists git switch but not git checkout as an important command This is a documentation inconsistency. It can't be both the canonical interface to use and experimental at the same time.
Re: New in Git: switch and restore
#70so maybe wait until that note is removed.