在我的项目的根目录中,我有一个foo文件夹.在foo文件夹里面我有一个bar文件夹.我想忽略对我bar文件夹中所有文件的所有更改.我有这个gitignore:
/foo/bar
Run Code Online (Sandbox Code Playgroud)
检查文件夹:它存在并且具有要忽略的文件.gitignore是commit特德.但是,我有一个文件,我在那里做了一个moification,并在我的bar文件夹中.当我输入
git status
Run Code Online (Sandbox Code Playgroud)
在我的内部,我git bash看到应该被忽略的文件.可能是什么原因以及如何成功忽略栏文件夹中的所有文件?
请注意,以前使用相同的行忽略了这些文件,但我必须暂时将该行删除到commit服务器上的某些内容.之后commit,我把线放回去了gitignore.这是不久前,但现在我已经观察到文件将在git status.我希望能够修改被忽略的文件,而不会出现在git status.
为了git忽略我的.idea/道路,我需要做些什么?
ctote@ubuntu:~/dev/1$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: .idea/.name
modified: .idea/misc.xml
modified: .idea/modules.xml
modified: .idea/vcs.xml
modified: .idea/workspace.xml
modified: src/Receiver.java
modified: test/1/agent/WindowsQueryHandlerTest.java
Untracked files:
(use "git add <file>..." to include in what will be committed)
lib/
mp1.iml
no changes added to commit (use "git add" …Run Code Online (Sandbox Code Playgroud) 我正在努力学习Git.我很困惑
git rm --cached file
Run Code Online (Sandbox Code Playgroud)
和
git reset file
Run Code Online (Sandbox Code Playgroud)
这两个命令似乎都将文件从暂存区域转移到非暂存区域.命令有何不同?
我.gitignore在我的仓库的根目录下有一个文件.该.gitignore文件具有以下模式以排除已编译的Python文件,这是该文件中的唯一行.
*.pyc
Run Code Online (Sandbox Code Playgroud)
现在,当我在回购的根目录下执行以下操作时.
git init
git add .
git status
Run Code Online (Sandbox Code Playgroud)
它显示它仍然跟踪.pyc文件并尝试将其添加为新文件.见下面的输出.
系统信息:Windows 7,cygwin
注意:此问题很明显,不是关于已被跟踪的被忽略文件.我还在文件上尝试了DOS和Unix风格的行结尾.gitignore.
git status 得到:
# On branch master
#
# Initial commit
#
# Changes to be committed:
# (use "git rm --cached <file>..." to unstage)
#
# new file: .gitignore
# new file: feedapp/__init__.py
# new file: feedapp/appconfig.py
# new file: feedapp/appconfig.pyc
Run Code Online (Sandbox Code Playgroud)
我该如何进一步排除故障?
我开始使用带有xcode项目的git,并且最近发现我可以使用.gitignore和.gitattributes文件来忽略编译器和系统的噪音. 现在我已经有了.gitignore和.gitattributes文件了,我如何"应用"新的忽略规则并摆脱版本控制的问题?
我的.gitignore文件是:
# xcode noise
*.modelv3
*.pbxuser
*.perspective
*.perspectivev3
*.pyc
*~.nib/
build/*
# Textmate - if you build your xcode projects with it
*.tm_build_errors
# old skool
.svn
# osx noise
.DS_Store
profile
Run Code Online (Sandbox Code Playgroud)
我的.gitattributes文件是:
*.pbxproj -crlf -diff -merge
Run Code Online (Sandbox Code Playgroud)
谢谢!
.gitignore文件在忽略我们不想控制的一些文件时非常有用.不幸的是,当文件已经受版本控制时,它无法使用.例如,我的.gitignore(已经添加到git)文件可能与我的同事想要的文件不同(例如,我想忽略Vim文件).每当我对此文件进行更改时,git都会将其显示为已修改的文件.所以我的问题:
我的.gitignore文件被忽略,应该忽略的文件仍然可见.
user@host ~/workdir % git status
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: .htaccess
# modified: application/controllers/statistics.php
#
no changes added to commit (use "git add" and/or "git commit -a")
user@host ~/workdir % cat .gitignore
.htaccess
application/config/config.php
application/config/database.php
user@host ~/workdir %
Run Code Online (Sandbox Code Playgroud)
这些文件处于版本控制状态,但是我不想推送明显的变化.git的RM ......是不是一种选择,因为这些文件应该在版本控制研究(与在文件中其他设置).我只是不想推动我对这些文件的更改.
我有一个.gitignore文件,它忽略了一些文件.我更新了.gitignore文件(删除了一些文件名并添加了一些文件名).这没有反映出来git status.如何强制git更新这些更改,以便跟踪之前未跟踪的文件,反之亦然.
我试过这个问题,仍然没有跟踪我的所有文件(根据我的更新.gitignore).(简单来说,一旦.gitignore更新或删除,我怎么能强制git撤回文件).
可能重复:
使用.git/info/exclude太迟
.gitignore文件而不是忽略
git - 从源代码控制中删除文件(但不是从源代码中删除)
我有CVS/我.gitignore和我的.git/info/exclude文件.但由于某些原因,仍然会跟踪任何CVS文件夹的更改.
我已经厌倦了手动取消这些文件夹中的更改.
一旦决定跟踪CVS文件夹,我如何让它停止跟踪CVS文件夹?
使用phpStorm IDE处理Symfony2项目,我添加了几个文件到git ignore但是一个文件尽管被添加到git ignore总是出现....我已经尝试了多次但它总是在那里
.gitignore文件:
/app/config/parameters.yml
/bin/
/build/
/composer.phar
/vendor/
/web/bundles/
/app/bootstrap.php.cache
/app/cache/*
!app/cache/.gitkeep
/app/config/parameters.yml
/app/logs/*
!app/logs/.gitkeep
/app/phpunit.xml
#IDE metadata
**.idea/**
#Bash files
run.sh
Run Code Online (Sandbox Code Playgroud)
并且git不会忽略的是.idea文件夹/文件:
On branch develop
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: .idea/workspace.xml
no changes added to commit (use "git add" and/or "git commit -a")
Run Code Online (Sandbox Code Playgroud)
知道为什么git不会忽略像我在gitignore中指定的整个目录......?