4 ms·
Git commands: How to reset my repo to match the remote? How to delete a file from repo but leave the local copy? How to undo an unpushed commit? I've actually
by wanderingstan 7y ago
Git commands: How to reset my repo to match the remote? How to delete a file from repo but leave the local copy? How to undo an unpushed commit?
I've actually started putting these in Anki[1] to memorize, along with python and js syntax. Too early to tell if I'll keep the reviewing habit, but so far it's going well.
[1] https://apps.ankiweb.net/ https://apps.ankiweb.net/
- szhu 7y agoI use fish shell, which lets you create abbreviations. Abbreviations are like shell aliases, except that after you type them, they expand to the entire command -- so it helps you memorize the real thing as well! Also there's auto-complete, which helps you find your saved abbreviations. For example, to save an abbreviation: $ abbr undo-unpushed-commit 'git reset --hard HEAD^' ... later ... Start typing a few chars and it'll suggest the rest: $ undo-u|npushed-commit Press the right arrow key to accept the suggestion $ undo-unpushed-commit| When you press enter or space, the abbreviation will expand: $ git reset --hard HEAD^ | --- There are a lot of other reasons to use fish shell. For example, when you save abbreviations or functions or aliases, they immediately persist and propagate to other shell windows! https://fishshell.com/ https://fishshell.com/
- jimmyvalmer 7y agoYup, I have "fork after clone" standing by in my google searchbox.