Git stashes offer a great way for you to create a temporary snapshot of what you're working on, without having to create a full-blown commit. Discover when that might be useful, and how to go about it.
What happens when you use that git stash command? Do you see an error, or does it just not work?
vim is a little confusing at first. It has the notion of different modes—two of which are command and insert modes. When you first open vim, you’re in command mode, which allows you to navigate around, and run different commands. However you can’t add new text without entering insert mode.
You can switch to insert mode by pressing lowercase i. vim will then behave like a traditional editor, until you press esc, which takes you out of insert mode, and back into command mode, at which point you can save and quit using :wq.
There are other ways to get into insert mode, that do things like “add a new line below”, or “replace the rest of this line”. You can find many good tutorials on vim across the web to learn more.
I didn’t realise that git stash push wasn’t in every recent version of git. git stash save -m "Message" should replicate the behaviour pretty closely (not sure whether they both have the same behaviour when clearing the working directory).
As for vim—whilst in vim, to add a new line a the end of the file and switch to insert mode type capital G and then lowercase o.
I’m able to do it like what Sam did in the tutorial, but I had to update git version to the latest.
My git version now is 2.14.1 from 2.11.0 (Apple Git-81).