我只想追踪从“es”开始、到*.h或*.m的档案。
i 审判:
#exlude all
*
#except
!es*.h
!es*.m
以及
#exlude all
*
#except
!*/es*.h
!*/es*.m
但是,在子公司中,既没有处理档案
我只想追踪从“es”开始、到*.h或*.m的档案。
i 审判:
#exlude all
*
#except
!es*.h
!es*.m
以及
#exlude all
*
#except
!*/es*.h
!*/es*.m
但是,在子公司中,既没有处理档案
当你忽视所有事项时(*
),你无视文件夹,即使文件内容也一样,因为*
与一切相符。
如果你
Your case can be solved easily but inverting the pattern.
What you basically want to do is ignore everything that
es
and .h
or .m
. 因此:
$ ls -a
. .. .git .gitignore a b blah c ebar.m esfoo.h esfoo.m sbar.m
$ ls -a blah/
. .. a b c ebar.m esfoo.h esfoo.m sbar.m
$ git status -s
?? blah/
?? esfoo.h
?? esfoo.m
$ git status -s blah/ # matching files ignored and also ignored on `git add`
?? blah/esfoo.h
?? blah/esfoo.m
$ git add .
$ git status -s # only wanted files were added
A blah/esfoo.h
A blah/esfoo.m
A esfoo.h
A esfoo.m
$ cat .gitignore # the ignore pattern -- ignore
[^e]* # everything that doesn t start with e
e[^s]* # and is not followed by an s
*.[^hm] # and does not end with .h or .m
!/blah # uningore the wanted subdirs
正如你在最后指挥中所看到的那样,我ve弃了你的规律,无视从<条码>开始、不随附<条码>、不随附<条码>、与<条码>相左的条码。 尽管继承人的内容更多,但随着其与模式相匹配而被忽视,只添加了被通缉的部分。
<<>edit>/em>:更新
Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...
I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...
I have a svn repo with various apps as subdirectory of a single svn repo. That worked because I could have checked out a partial, repo. As I cant do that with git obviously I need multiple repos. I ...
I understand how to merge branches together in git, and I love how easy it makes it. I have a branch that looks like this: project/ |--subproj1/ | |---(files) | |--subproj2/ |---(files) A ...
We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...
I get this on every git svn command I try. I am using git version 1.6.4.2 on OS 10.6 The initial git svn fetch works, and i can do further fetches after that, but they do not enter the log or update ...
Given I have a master branch and a other branch. In the other branch are files I don t want to commit (e.g. log files) so I ignored them in .gitignore. When I switch to the master branch, these ...
Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...