mysysgit - github 怎么重复覆盖更新?
PHP中文网
PHP中文网 2017-05-02 09:31:25
0
6
832

比如我先把 github 的项目 pull 下来,然后修修改改,发现“噢,写得有点乱”,一个个删除有点太麻烦了,当然也可以重新 clone 一份下来,但有没有可以重新覆盖更新一份的方法。
百度了好久也找不到,新人刚接触,不要嫌弃!!

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(6)
给我你的怀抱

git reset --hard,移除所有未提交的本地改动。
git fetch && git reset --hard origin/master, use the warehouse on github to cover the local area, and the local submissions will also be removed.
It is recommended to back up before use.

滿天的星座

Except git reset --hard,也可以考虑使用git checkout .撤销所有文件的修改(新增或删除文件无效),git checkout [特定文件路径]针对某些文件撤销修改,多个路径以空格隔开。
另外需注意如果你已经git commit, you cannot use checkout.

黄舟

git checkout file

Ty80

1. The staging area contains changes
git reset HEAD file
git checkout -- file
2. No changes are included
git checkout -- file

Note:
file is the name of your file
git status to view changes in the staging area

git is a website where you can learn it systematically

刘奇

There are a lot of searches on this website, how could you not find it? It seems that your search ability...

我想大声告诉你

There are a lot of searches on this website, why can’t you find it? Are you searching for the wrong keywords...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!