我在我的github帐户中有一个fork,我将fork克隆到我的本地计算机上。现在我做了一些提交,并将其推送到origin
。然后,我直接在GitHub中更新了fork中的readme.md
文件,不在本地克隆中。我做了一个名为Updated readme.md file
的提交。
现在我想将它与本地计算机同步。所以我跑了git pull
。
这给了我错误:
Cannot pull with rebase: You have unstaged changes.
Please commit or stash them.
在上次提交后,我在本地计算机上修改了2个文件。但我不再想要改变了。因此,我想删除对这两个文件所做的任何更改,并与origin
保持同步。
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: scripts/filename.js
Untracked files:
(use "git add <file>..." to include in what will be committed)
scripts/anotherfile.js
no changes added to commit (use "git add" and/or "git commit -a")