Git ::很多未跟踪的文件


2

我刚刚在我的机器上添加了一个新的git repo,我发现它非常凌乱git status。它显示了我桌面上的一堆文件,c:/,基本上几乎无处不在。由于某种原因,它出现在项目文件夹之外,我只是心慌。我跑去git clean -xf看看是否清理了我的git状态,但它没有。

如果这是正常行为,请告诉我。

David@PERSONAL ~/Desktop/Code/projects/laraforum (master)
$ git status
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)

        ../../../../.VirtualBox/
        ../../../../.WebIde70/
        ../../../../.bash_history
        ../../../../.bash_profile
        ../../../../.bashrc
        ../../../../.codeintel/
        ../../../../.gitconfig
        ../../../../.hgrc
        ../../../../.ssh/
        ../../../../.vagrant.d/
        ../../../../AppData/
        ../../../../BullseyeCoverageError.txt
        ../../../../Contacts/
        ../../experiments/
        ../hyphenical/
        ../thecoremc/
        ../../../David Ponce              9.docx
        ../../../Development/
        ../../../Music/
        ../../../New Text Document.txt
        ../../../Passwords.txt
        ../../../Photoshop Tools/
        ../../../Recordings/
        ../../../desktop.ini
        ../../../laravel-blade.tmLanguage.txt
        ../../../question.PNG
        ../../../syudJMa.png
        ../../../~$vid Ponce              1.docx
        ../../../~WRL2005.tmp
        "../../../\302\265Torrent.lnk"
        ../../../../Documents/
        ../../../../Downloads/
        ../../../../Favorites/
        ../../../../IntelGraphicsProfiles/
        ../../../../Links/
        ../../../../Music/
        ../../../../NTUSER.DAT
        ../../../../NTUSER.DAT{bbed3e3b-0b41-11e3-8249-d6927d06400b}.TM.blf
        ../../../../NTUSER.DAT{bbed3e3b-0b41-11e3-8249-d6927d06400b}.TMContaine
00000000000000000001.regtrans-ms
        ../../../../NTUSER.DAT{bbed3e3b-0b41-11e3-8249-d6927d06400b}.TMContaine
00000000000000000002.regtrans-ms
        ../../../../OneDrive/
        ../../../../PUTTY.RND
        ../../../../Pictures/
        ../../../../Saved Games/
        ../../../../Searches/
        ../../../../Vagrantfile
        ../../../../Videos/
        ../../../../VirtualBox VMs/
        ../../../../_viminfo
        ../../../../coreessentials/
        ../../../../homestead/
        ../../../../ntuser.dat.LOG1
        ../../../../ntuser.dat.LOG2
        ../../../../ntuser.ini
        ../../../../website/
        ../../../../workspace/

nothing added to commit but untracked files present (use "git add" to track)

我在一个干净的laravel装置里面跑了这个。这是git忽略的:

.env.*
/.idea
/vendor
.DS_Store
Thumbs.db
composer.lock
composer.phar

我不知道这对我来说是不是错了,也不知道我有git设置的方式。

我的项目文件夹包含一个干净的laravel安装。

编辑:当我在项目文件夹中运行git init时,git status没有显示存储库外的所有未跟踪文件。

Answers:


0

在Windows下,弹出打开a cmd.exe,然后运行

dir \.git /s /p

现在阅读它找到的每个文件夹的路径,并问自己该.git文件夹是否确实需要存在。

Git允许您cd进入项目并运行git命令。它.git在当前文件夹中搜索一个文件夹,然后检查每个父文件夹。(相比之下,Subversion .svn在每个已提交的文件夹中都需要一个文件夹,这非常笨拙。)


该命令不起作用。Invalid switch - ".git".
大卫

修正了当前的答案
Phlip 2014年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.