文件出现在未跟踪的列表Git Commit但不在Git Status上 [英] File Appear on Untracked list Git Commit but not on Git Status

查看:176
本文介绍了文件出现在未跟踪的列表Git Commit但不在Git Status上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发iOS项目,当我尝试在终端中执行git commit -a命令时,它会提供未跟踪文件的列表:


未记录的文件:



(使用git add ...来包含将要提交的内容)

*。xcodeproj /


同时,当我尝试执行git status命令时,不列出它作为未跟踪的文件,但列表


*。xcodeproj / project.pbxproj


作为修改后的文件。



我还需要推吗?

解决方案

在推送任何内容之前,您需要添加并提交未跟踪的文件。

  git add * .xcodeproj / 

或将它添加到.gitignore文件并忽略它。



comit和status之间的显示差异可能是由于 - untracked-files 选项。

  -u [< mode> ;] 
--untracked-files [=< mode>]




显示未跟踪的文件。



mode参数是可选的(默认为 all ),指定未跟踪文件的处理;当不使用 -u 时,默认是正常的,即显示未跟踪的文件和目录。



可能的选项是:




  • no - 不显示未追踪的档案

  • 正常 - 显示未追踪的文件和目录。 strong> all - 同时显示未跟踪目录中的单个文件。


I'm working on iOS project and when I'm trying to do "git commit -a" command in terminal, it gives list of untracked files:

Untracked files:

(use "git add ..." to include in what will be committed)

*.xcodeproj/

Meanwhile, when I try to do "git status" command, the console does not list it as untracked files, but list

*.xcodeproj/project.pbxproj

as modified file.

Do I need still to push it?

解决方案

Before pushing anything, you would need to add and commit those untracked files.

git add *.xcodeproj/

Or to add it to the .gitignore file and ignore it.

The difference of display between comit and status is probably due to the --untracked-files option.

-u[<mode>]
--untracked-files[=<mode>]

Show untracked files.

The mode parameter is optional (defaults to all), and is used to specify the handling of untracked files; when -u is not used, the default is normal, i.e. show untracked files and directories.

The possible options are:

  • no - Show no untracked files
  • normal - Shows untracked files and directories
  • all - Also shows individual files in untracked directories.

这篇关于文件出现在未跟踪的列表Git Commit但不在Git Status上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆