git提交指定文件
在目录下新建 1.txt 2.txt
分别在两个文件中写入test1 test2内容
在git命令行下输入
git add 1.txt
git status 查看 显示如下内容
$ git status On branch master Your branch is up to date with 'origin/master'. Changes to be committed: (use "git restore --staged <file>..." to unstage) new file: 1.txt Untracked files: (use "git add <file>..." to include in what will be committed) 2.txtgit commit -m 'add 1.txt'
git push或者 git push origin master
添加某个文件夹下的指定文件
继续在此目录下 添加test文件夹,新建文件 3.txt
在 3.txt中写入 test3
git add other/3.txt
git status 查看
$ git status On branch master Your branch is up to date with 'origin/master'. Changes to be committed: (use "git restore --staged <file>..." to unstage) new file: test/3.txt Untracked files: (use "git add <file>..." to include in what will be committed) 2.txtgit commit -m 'add test/3.txt'
git push 或者 git push origin master
以上就是git 提交指定文件的全部内容。

本文详细介绍了如何使用Git提交特定文件或文件夹下的指定文件,包括在本地目录创建新文件、使用git add命令添加文件、查看状态、提交更改并推送到远程仓库的全过程。
5万+

被折叠的 条评论
为什么被折叠?



