git 在服务器上拉单个文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11245424/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 07:08:37 来源:igfitidea点击:
Pull single file on server
提问by confofact
I have committed several files on GitHub but I want to pull only single file on server. How can I do that using PuTTY?
我在 GitHub 上提交了多个文件,但我只想在服务器上提取单个文件。我怎样才能使用 PuTTY 做到这一点?
回答by helt
git fetch
git checkout -m revision -- the/file/you/want
git add the/file/you/want
git commit
checkout the file you want and merge it with the current one
签出您想要的文件并将其与当前文件合并
回答by Alex Howansky
You can grab a single file via this URL:
您可以通过此 URL 获取单个文件:
https://raw.github.com/USER/PROJECT/BRANCH/FILE