Git 不推送 .bat 文件
Git not pushing .bat files
我(据我所知)在我的本地存储库中没有 .gitignore 文件设置,但是当我提交并推送时(即使在执行 git add --all ) repo 不会推送 .bat 文件(以及其他几种文件类型)。我正在使用 Git bash 和 Windows。
我正在使用的命令:
git add --all
git commit -m "next commit here" .
git push -u origin master
git pull
确保您没有全局 .gitignore 文件。检查此详细信息:
https://help.github.com/articles/ignoring-files/
每当您尝试解决 Git 忽略问题时,check-ignore
command 很有用:
For each pathname given via the command-line or from a file via --stdin
, show the pattern from .gitignore (or other input files to the exclude mechanism) that decides if the pathname is excluded or included. Later patterns within a file take precedence over earlier ones.
我建议使用 --verbose
/ -v
标志将其指向有问题的文件,例如
git check-ignore --verbose path/to/file.bat
你应该得到像
这样的输出
.gitignore:5:*.bat path/to/file.bat
表示,在这种情况下,您的文件被文件 .gitignore
第 5 行中的模式 *.bat
忽略,或者没有输出且 return 值为 1 , 说明文件没有被忽略。
小心运行一次针对多个文件;如果其中一个被忽略,你将获得一个成功的 return 值 0。
请输入:"git add .",然后 "git status" 检查您的 *.bat 文件是否可见并标有绿色。如果不可见,则表示 *.bat 扩展名已添加到 gitignore,应从那里删除。
我(据我所知)在我的本地存储库中没有 .gitignore 文件设置,但是当我提交并推送时(即使在执行 git add --all ) repo 不会推送 .bat 文件(以及其他几种文件类型)。我正在使用 Git bash 和 Windows。
我正在使用的命令:
git add --all
git commit -m "next commit here" .
git push -u origin master
git pull
确保您没有全局 .gitignore 文件。检查此详细信息: https://help.github.com/articles/ignoring-files/
每当您尝试解决 Git 忽略问题时,check-ignore
command 很有用:
For each pathname given via the command-line or from a file via
--stdin
, show the pattern from .gitignore (or other input files to the exclude mechanism) that decides if the pathname is excluded or included. Later patterns within a file take precedence over earlier ones.
我建议使用 --verbose
/ -v
标志将其指向有问题的文件,例如
git check-ignore --verbose path/to/file.bat
你应该得到像
这样的输出.gitignore:5:*.bat path/to/file.bat
表示,在这种情况下,您的文件被文件 .gitignore
第 5 行中的模式 *.bat
忽略,或者没有输出且 return 值为 1 , 说明文件没有被忽略。
小心运行一次针对多个文件;如果其中一个被忽略,你将获得一个成功的 return 值 0。
请输入:"git add .",然后 "git status" 检查您的 *.bat 文件是否可见并标有绿色。如果不可见,则表示 *.bat 扩展名已添加到 gitignore,应从那里删除。