简体   繁体   English

如何更新 github 项目中的单个页面?

[英]How to update individual page in github project?

I have already published a project on the heroku now I want to update my individual page with individual commit.我已经在heroku上发布了一个项目,现在我想用个人提交更新我的个人页面。

when I try by this way:当我通过这种方式尝试时:

git fetch
git checkout -m <revision> <yourfilepath>
git add <yourfilepath>
git commit

But, when I go on the git checkout -m <revision> <filepath> then my updated value or data has deleted.但是,当我在git checkout -m <revision> <filepath>上的 go 时,我的更新值或数据已被删除。

I had did like this: git checkout -m master.\client\src\pages\About.js我曾经这样做过: git checkout -m master.\client\src\pages\About.js

I have followed from here but still can't solved my problem我从这里开始但仍然无法解决我的问题

I don't know how to solve this problem.我不知道如何解决这个问题。

Anyone find my mistake!任何人都发现我的错误!

With Git 2.23+ , I would advice to use instead git restore , which only deals with files.使用 Git 2.23+ ,我建议改用git restore ,它只处理文件。
Example, to get just one file , and add it to the index, in one command:例如,在一个命令中只获取一个文件并将其添加到索引中:

 git restore --source <revision> --staged --worktree -- <yourfilepath>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM