如何在Git中仅提交特定文件? [英] How can I commit only specific files in Git?
本文介绍了如何在Git中仅提交特定文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我的本地存储库中有1000个文件,而我只想提交和推送700个文件,有可能吗?
If there are 1000 files in my local repository, and I want to commit and push only 700 files, is there a possibility?
推荐答案
您可以使用git commit [files]
以便仅将某些文件提交到存储库中,或者可以使用Git的暂存区逐渐添加要使用的文件git add [file]
,然后再提交.
You can use git commit [files]
in order to commit only certain files to your repository OR you can make use of Git's staging area to gradually add the files you want using git add [file]
before you commit.
您可以查看本指南有关Git和版本控制的更完整介绍.
You can check out this guide for a more complete introduction to Git and version control.
这篇关于如何在Git中仅提交特定文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文