如何使用Coab在GitHub上删除文件夹? [英] How to remove folder on GitHub using Coab?

查看:124
本文介绍了如何使用Coab在GitHub上删除文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将我的仓库克隆到其中有一些文件夹和文件的地方:

I clone my repo where I have some folders and files:

!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仍在我的存储库中.我在做什么错了?

After that my folder sample_data is still in my repo. What am I doing wrong?

推荐答案

在提交之前,您需要进行更改:

Before you can commit you need to stage your changes:

git add --all 

进行所有更改

Stage all the changes

然后再次运行git commit -m "Your message".

运行git commit -m "Message"

未添加任何更改即可提交

no changes added to commit

Git告诉您,提交中未添加任何内容.

Git told you that nothing was added to the commit.

这篇关于如何使用Coab在GitHub上删除文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆