【发布时间】:2020-02-02 02:40:40
【问题描述】:
我克隆了我的仓库,其中有一些文件夹和文件:
!git clone https://{username}:{password}@github.com/{username}/{project}.git
然后我改变当前目录:
%cd {project}
删除文件夹:
!rm -rf "/content/{project}/sample_data"
检查状态:
!git status
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
deleted: sample_data/README.md
deleted: sample_data/anscombe.json
deleted: sample_data/california_housing_test.csv
deleted: sample_data/california_housing_train.csv
deleted: sample_data/mnist_test.csv
deleted: sample_data/mnist_train_small.csv
no changes added to commit (use "git add" and/or "git commit -a")
提交:
!git commit -m "Removed all"
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
deleted: sample_data/README.md
deleted: sample_data/anscombe.json
deleted: sample_data/california_housing_test.csv
deleted: sample_data/california_housing_train.csv
deleted: sample_data/mnist_test.csv
deleted: sample_data/mnist_train_small.csv
no changes added to commit
然后推送:
!git push origin master
之后,我的文件夹 sample_data 仍在我的仓库中。我做错了什么?
【问题讨论】:
标签: python github google-colaboratory