diff --git a/GitPusher.ipynb b/GitPusher.ipynb new file mode 100644 index 0000000..ab2b6db --- /dev/null +++ b/GitPusher.ipynb @@ -0,0 +1,58 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from git import Repo\n", + "\n", + "repo_dir = 'C:\\Users\\Misha\\Documents\\GitHub\\Staging'\n", + "repo = Repo(repo_dir)\n", + "file_list = [repo_dir+'\\Test1 - Copy.txt',\n", + " repo_dir+'\\GitPusher.ipynb']\n", + "commit_message = 'Testme'\n", + "repo.index.add(file_list)\n", + "repo.index.commit(commit_message)\n", + "origin = repo.remote('origin')\n", + "origin.push()\n" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [default]", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 1 +} diff --git a/GitPusher2.ipynb b/GitPusher2.ipynb new file mode 100644 index 0000000..ab2b6db --- /dev/null +++ b/GitPusher2.ipynb @@ -0,0 +1,58 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from git import Repo\n", + "\n", + "repo_dir = 'C:\\Users\\Misha\\Documents\\GitHub\\Staging'\n", + "repo = Repo(repo_dir)\n", + "file_list = [repo_dir+'\\Test1 - Copy.txt',\n", + " repo_dir+'\\GitPusher.ipynb']\n", + "commit_message = 'Testme'\n", + "repo.index.add(file_list)\n", + "repo.index.commit(commit_message)\n", + "origin = repo.remote('origin')\n", + "origin.push()\n" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [default]", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 1 +}