{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "e6149cb4-9b21-4a74-b291-0e235545fd19", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Reinitialized existing Git repository in C:/Users/korne/Documents/git/ium_478815/.git/\n" ] } ], "source": [ "!git init" ] }, { "cell_type": "code", "execution_count": 4, "id": "57e08933-c129-40fe-a66d-c9af848f6e15", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Initialized DVC repository.\n", "\n", "You can now commit the changes to git.\n", "\n", "+---------------------------------------------------------------------+\n", "| |\n", "| DVC has enabled anonymous aggregate usage analytics. |\n", "| Read the analytics documentation (and how to opt-out) here: |\n", "| |\n", "| |\n", "+---------------------------------------------------------------------+\n", "\n", "What's next?\n", "------------\n", "- Check out the documentation: \n", "- Get help and share ideas: \n", "- Star us on GitHub: \n" ] } ], "source": [ "!dvc init" ] }, { "cell_type": "code", "execution_count": 5, "id": "c4887a28-9070-4334-ad28-e73df0e8ba95", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "On branch master\n", "Your branch is up to date with 'origin/master'.\n", "\n", "Changes to be committed:\n", " (use \"git restore --staged ...\" to unstage)\n", "\tnew file: .dvc/.gitignore\n", "\tnew file: .dvc/config\n", "\tnew file: .dvcignore\n", "\n", "Changes not staged for commit:\n", " (use \"git add/rm ...\" to update what will be committed)\n", " (use \"git restore ...\" to discard changes in working directory)\n", "\tdeleted: petite-difference-challenge2\n", "\n", "Untracked files:\n", " (use \"git add ...\" to include in what will be committed)\n", "\t.ipynb_checkpoints/\n", "\tUntitled.ipynb\n", "\tinit/\n", "\n" ] } ], "source": [ "!git status" ] }, { "cell_type": "code", "execution_count": 6, "id": "09d5820e-9160-46b4-9b09-c8e7067d5614", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[master 2880651] Initial commit\n", " 3 files changed, 6 insertions(+)\n", " create mode 100644 .dvc/.gitignore\n", " create mode 100644 .dvc/config\n", " create mode 100644 .dvcignore\n" ] } ], "source": [ "!git commit -m \"Initial commit\"" ] }, { "cell_type": "code", "execution_count": 15, "id": "471bb42c-0aa9-4f80-8886-62ac1f5ffd65", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "To track the changes with git, run:\n", "\n", " git add .gitignore data.csv.dvc\n", "\n", "To enable auto staging, run:\n", "\n", "\tdvc config core.autostage true\n" ] } ], "source": [ "!dvc add data.csv" ] }, { "cell_type": "code", "execution_count": 13, "id": "b0ecb958-3587-4e05-a805-2f2d3f202a76", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "rm 'data.csv'\n" ] } ], "source": [ "!git rm -r --cached data.csv" ] }, { "cell_type": "code", "execution_count": 27, "id": "0a603570-e604-4fe5-aab5-35a8b52349cb", "metadata": {}, "outputs": [], "source": [ "!mkdir data" ] }, { "cell_type": "code", "execution_count": 33, "id": "e67d3153-5d4f-4c08-9a22-6da1e733ddff", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " 1 file(s) moved.\n" ] } ], "source": [ "!move data.csv data/" ] }, { "cell_type": "code", "execution_count": 14, "id": "e0e98bc7-05c7-4559-ab72-59789078a0ff", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[master 1094a03] stop tracking data.csv\n", " 1 file changed, 4601 deletions(-)\n", " delete mode 100644 data.csv\n" ] } ], "source": [ "!git commit -m \"stop tracking data.csv\" " ] }, { "cell_type": "code", "execution_count": 34, "id": "2558ce6e-30a0-4c4c-93b5-fdaf4094d6ba", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "To track the changes with git, run:\n", "\n", " git add 'data\\data.csv.dvc' 'data\\.gitignore'\n", "\n", "To enable auto staging, run:\n", "\n", "\tdvc config core.autostage true\n" ] } ], "source": [ "!dvc add data/data.csv" ] }, { "cell_type": "code", "execution_count": 35, "id": "6c78dec3-5e84-408e-bc18-a1d6479e29ae", "metadata": {}, "outputs": [], "source": [ "!git add data/data.csv.dvc data/.gitignore" ] }, { "cell_type": "code", "execution_count": 36, "id": "e18dc1d8-a34c-470c-a029-64a566f4edf8", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[master 302d4bd] Dodano dane dvc\n", " 2 files changed, 5 insertions(+)\n", " create mode 100644 data/.gitignore\n", " create mode 100644 data/data.csv.dvc\n" ] } ], "source": [ "!git commit -m \"Dodano dane dvc\"" ] }, { "cell_type": "code", "execution_count": 40, "id": "4eca03b0-b949-4eab-9145-4bb43ba2664f", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Parameter format not correct - \"data\".\n" ] } ], "source": [] }, { "cell_type": "code", "execution_count": 43, "id": "487150ca-dc73-4acb-9034-0b39a7c71838", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Setting 'my_local_remote' as a default remote.\n" ] } ], "source": [ "!dvc remote add -d my_local_remote /dvcstore -f" ] }, { "cell_type": "code", "execution_count": 44, "id": "7e90da01-b1b5-405e-94bc-aa51676f076f", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "On branch master\n", "Your branch is ahead of 'origin/master' by 1 commit.\n", " (use \"git push\" to publish your local commits)\n", "\n", "Changes not staged for commit:\n", " (use \"git add ...\" to update what will be committed)\n", " (use \"git restore ...\" to discard changes in working directory)\n", "\tmodified: Untitled.ipynb\n", "\n", "no changes added to commit (use \"git add\" and/or \"git commit -a\")\n" ] } ], "source": [ "!git status" ] }, { "cell_type": "code", "execution_count": 45, "id": "0bdb37ec-5d22-4bcd-a58f-ec306b1292a5", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "On branch master\n", "Your branch is ahead of 'origin/master' by 1 commit.\n", " (use \"git push\" to publish your local commits)\n", "\n", "Changes not staged for commit:\n", " (use \"git add ...\" to update what will be committed)\n", " (use \"git restore ...\" to discard changes in working directory)\n", "\tmodified: Untitled.ipynb\n", "\n", "no changes added to commit (use \"git add\" and/or \"git commit -a\")\n" ] } ], "source": [ "!git add .dvc/config\n", "!git commit -m \"Added DVC remote\"" ] }, { "cell_type": "code", "execution_count": 47, "id": "77ecb697-f936-4ea4-9d16-bcd870ab8561", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Everything is up to date.\n" ] } ], "source": [ "!dvc push" ] }, { "cell_type": "code", "execution_count": 49, "id": "ab2536de-44fc-41cf-b266-9d04c779206a", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Invalid switch - /dvc\n" ] } ], "source": [ "!tree /dvc" ] }, { "cell_type": "code", "execution_count": 51, "id": "c3ce7965-a94e-4b87-9bc0-9095b9dddd4b", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "warning: LF will be replaced by CRLF in Untitled.ipynb.\n", "The file will have its original line endings in your working directory\n" ] } ], "source": [ "!git add ." ] }, { "cell_type": "code", "execution_count": null, "id": "aa5bc809-1add-4b55-ad3e-0c3fcf80f5c6", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.12" } }, "nbformat": 4, "nbformat_minor": 5 }