1

我在本地删除了几个不必要的文件,还更改了一些文件的位置。我希望我的 github 存储库与我在本地拥有的存储库相匹配。

我以前使用过命令:

git rm

删除特定文件,但我想知道是否有更有效的方法来做到这一点。

4

3 回答 3

2

To ensure that your local repo. matches the github repo. just run git status, check and see if an y files have been modified, deleted, or added. If so, then you can stage those files to be commited.

To stage a file(s) to be commited, I typically use

git add <rel_path_to_file> (for each file that is to be changed or added) followed by a

git commit -m 'your commit message'

then when you're through staging the files that you'd like to commit, or telling git what you want to change in the github repo and what note to leave when you change it, just run git push

Hope that helps!

于 2013-10-03T20:02:52.583 回答
2

git rm [插入文件名_这里]

其次是

git commit -am "已删除废话"

git 推送

于 2013-10-03T19:53:51.620 回答
0

git rm

你应该做

git status

看到你的变化,以避免一些意想不到的变化。然后做,

git commiy -a -m "delete XXXX"

然后做,

git pull origin.

最后的,

git push

于 2013-10-04T07:28:00.600 回答