Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

仓库根目录 .gitignore 文件中的嵌套 exclusion 规则无效 #413

Closed
5 of 11 tasks
Lodour opened this issue Sep 14, 2018 · 2 comments · Fixed by #832 or #1438
Closed
5 of 11 tasks

仓库根目录 .gitignore 文件中的嵌套 exclusion 规则无效 #413

Lodour opened this issue Sep 14, 2018 · 2 comments · Fixed by #832 or #1438

Comments

@Lodour
Copy link

Lodour commented Sep 14, 2018

I agree and want to create new issue


Expected behavior

根据 /.gitignore 中的嵌套排除规则,以及推测的意图

  • !source/lib/font-awesome/*
  • !source/lib/ua-parser-js/dist/

执行以下操作应能被 Git 探测:

  • touch source/lib/font-awesome/dirty
  • touch source/lib/ua-parser-js/dist/dirty

Actual behavior

并不能,具体输出详见 Other Information 部分。

初步影响在于,若将源文件 push 后再 clone 至其他环境重新编辑,上述目录将被忽略,进而在部署时无法被复制至 public 目录中。

至于从该项目直接 clone 至本地不受影响,可能的原因是在增加这些规则前,上述目录已经被索引,没有进一步处理。

Steps to reproduce the behavior

  1. git clone git@github.com:theme-next/hexo-theme-next.git
  2. cd hexo-theme-next/
  3. touch source/lib/font-awesome/dirty
  4. touch source/lib/ua-parser-js/dist/dirty
  5. git status
  6. nothing to commit, working tree clean
  • Link to demo site with this issue: N/A
  • Link(s) to source code or any usefull link(s): N/A

Node.js and NPM Information

irrelevant

Package dependencies Information

irrelevant

Hexo Information

Hexo version

irrelevant

Hexo Configuration

irrelevant

NexT Information

NexT Version:

  • Latest Master branch
  • Latest Release version
  • Old version

NexT Scheme:

  • All schemes
  • Muse
  • Mist
  • Pisces
  • Gemini

NexT Configuration:

irrelevant

Other Information

对于 source/lib/font-awesome 部分,执行 touch source/lib/font-awesome/dirty 后,

对于以下原有规则,

source/lib/font-awesome/less/
source/lib/font-awesome/scss/
!source/lib/font-awesome/*

执行 git status,输出如下:

On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

修改为如下规则后,

!source/lib/font-awesome/
source/lib/font-awesome/less/
source/lib/font-awesome/scss/
!source/lib/font-awesome/*

再次执行 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:   .gitignore

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	source/lib/font-awesome/dirty

no changes added to commit (use "git add" and/or "git commit -a")

嵌套的排除规则有些麻烦,以上供参考。

@sli1989
Copy link
Collaborator

sli1989 commented Sep 16, 2018

for now, the exist commands in .gitignore seems unrelated to deploy. just not put into source/lib/font-awesome/less/ and source/lib/font-awesome/scss/.
need others to confirm.

@stale
Copy link

stale bot commented Nov 15, 2018

This issue has been automatically marked as stale because lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants