From e08077cb8ccf12f34e5616222046bc7fcb6b3885 Mon Sep 17 00:00:00 2001 From: Donne Martin Date: Tue, 18 Aug 2015 07:13:28 -0400 Subject: [PATCH] Added common git stash commands. --- commands/add_these.ipynb | 144 +++++++++++++++++++++++++++++++++++++++ commands/misc.ipynb | 14 ++++ 2 files changed, 158 insertions(+) create mode 100644 commands/add_these.ipynb diff --git a/commands/add_these.ipynb b/commands/add_these.ipynb new file mode 100644 index 0000000..3d08e71 --- /dev/null +++ b/commands/add_these.ipynb @@ -0,0 +1,144 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:ddec3db248ab2963bf72b2088852b351cab1451a8216cc20a88f1ade052fa425" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Command Lines" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Done\n", + "http://coolestguidesontheplanet.com/how-to-compress-and-uncompress-files-and-folders-in-os-x-lion-10-7-using-terminal/" + ], + "language": "python", + "metadata": {}, + "outputs": [] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Done\n", + "http://stackoverflow.com/questions/16661982/check-folder-size-in-bash" + ], + "language": "python", + "metadata": {}, + "outputs": [] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Done\n", + "http://www.cyberciti.biz/faq/show-all-running-processes-in-linux/" + ], + "language": "python", + "metadata": {}, + "outputs": [] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Done\n", + "http://www.thegeekstuff.com/2012/04/curl-examples/" + ], + "language": "python", + "metadata": {}, + "outputs": [] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Done\n", + "List number of files matching \u201c.txt\"\n", + "ls -1 | grep .txt | wc -l" + ], + "language": "python", + "metadata": {}, + "outputs": [] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Done\n", + "# Delete matching lines in place:\n", + "sed -i '/Important Lines: /d\u2019 original_file" + ], + "language": "python", + "metadata": {}, + "outputs": [] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "http://www.binarytides.com/linux-find-command-examples/\n", + " \n", + "Search for MySQL config\n", + "sudo find / -name \u2018mysql.cnf\u2019\n", + "\n", + "Search for a file with matching name\n", + "sudo find / -name \u2018site.cfg\u2019\n", + "\n", + "# Locate a program file in the user's path\n", + "which python" + ], + "language": "python", + "metadata": {}, + "outputs": [] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "CMD: Analytics\n", + "CMD: Misc" + ], + "language": "python", + "metadata": {}, + "outputs": [] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "https://danielmiessler.com/study/vim" + ], + "language": "python", + "metadata": {}, + "outputs": [] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Ruby\n", + "curl -sSL https://get.rvm.io | bash -s stable\n", + "\n", + "brew doctor\n", + "rvm install 1.8.7 --with-gcc=clang" + ], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/commands/misc.ipynb b/commands/misc.ipynb index b7565c3..fa60afc 100644 --- a/commands/misc.ipynb +++ b/commands/misc.ipynb @@ -251,6 +251,20 @@ "!git commit --amend\n", "!git push --force [branch]\n", "\n", + "# Take the dirty state of your working directory\n", + "# and save it on a stack of unfinished changes\n", + "!git stash\n", + "\n", + "# Get list of stashes\n", + "!git stash list\n", + "\n", + "# Apply the top stash, re-modifying the \n", + "# uncommitted files when the stash was saved\n", + "!git stash apply\n", + "\n", + "# Apply a stash at the specified index\n", + "!git stash apply stash@{1}\n", + "\n", "# Create a branch\n", "!git branch [branch]\n", "\n",