[GH-ISSUE #1160] Enhancement: core.excludesfile .gitignore (file) support #651

Open
opened 2026-03-01 21:45:14 +03:00 by kerem · 1 comment
Owner

Originally created by @hakre on GitHub (May 11, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1160

Describe feature

the git (config) core.excludesfile sets a user-wide core ".gitignore" that applies to all projects.

currently act's .gitignore feature does not take it into account, paths ignored by it are copied into the container.

Backgound: core.excludesfile git-config Setting

from the git-book (Customizing Git Configuration):

core.excludesfile
You can put patterns in your project’s .gitignore file to have Git not see them as untracked files or try to stage them when you run git add on them, as discussed in Ignoring Files.

But sometimes you want to ignore certain files for all repositories that you work with. If your computer is running macOS, you’re probably familiar with .DS_Store files. If your preferred editor is Emacs or Vim, you know about filenames that end with a ~ or .swp.

This setting lets you write a kind of global .gitignore file. If you create a ~/.gitignore_global file with these contents:

*~
.*.swp
.DS_Store

…and you run git config --global core.excludesfile ~/.gitignore_global, Git will never again bother you about those files.

another reference is core.excludesFile on the git-config(1) page:

core.excludesFile
Specifies the pathname to the file that contains patterns to describe paths that are not meant to be tracked, in addition to .gitignore (per-directory) and .git/info/exclude. Defaults to $XDG_CONFIG_HOME/git/ignore. If $XDG_CONFIG_HOME is either not set or empty, $HOME/.config/git/ignore is used instead. See gitignore[5].

act's .gitignore feature

  • .gitignore file support:
    • .gitignore (per-directory) support: exists (by default, disable per --use-gitignore=false, compare #537)
    • .git/info/exclude support: exists (see #1000)
    • core.excludesfile support: missing (this feature request #1160)
  • git repo index support: exists (we may see it as unconfirmed/regression, compare #912)
  • git-worktree(1) support: this is a different beast, see #829

(report backstory: #1158)

Originally created by @hakre on GitHub (May 11, 2022). Original GitHub issue: https://github.com/nektos/act/issues/1160 ## Describe feature the git (config) `core.excludesfile` sets a user-wide core ".gitignore" that applies to all projects. currently act's `.gitignore` feature does not take it into account, paths ignored by it are copied into the container. ### Backgound: `core.excludesfile` git-config Setting from the [git-book (Customizing Git Configuration)](https://www.git-scm.com/book/en/v2/Customizing-Git-Git-Configuration): > **`core.excludesfile`** > You can put patterns in your project’s `.gitignore` file to have Git not see them as untracked files or try to stage them when you run git add on them, as discussed in [Ignoring Files](https://www.git-scm.com/book/en/v2/ch00/_ignoring). > > But sometimes you want to ignore certain files for all repositories that you work with. If your computer is running macOS, you’re probably familiar with `.DS_Store` files. If your preferred editor is Emacs or Vim, you know about filenames that end with a `~` or `.swp`. > > This setting lets you write a kind of global .gitignore file. If you create a ~/.gitignore_global file with these contents: > > *~ > .*.swp > .DS_Store > > …and you run `git config --global core.excludesfile ~/.gitignore_global`, Git will never again bother you about those files. another reference is [`core.excludesFile` on the git-config(1) page](https://www.git-scm.com/docs/git-config/2.25.2#Documentation/git-config.txt-coreexcludesFile): > **`core.excludesFile`** > Specifies the pathname to the file that contains patterns to describe paths that are not meant to be tracked, in addition to `.gitignore` (per-directory) and `.git/info/exclude`. Defaults to `$XDG_CONFIG_HOME/git/ignore`. If `$XDG_CONFIG_HOME` is either not set or empty, `$HOME/.config/git/ignore` is used instead. See [gitignore[5]](https://www.git-scm.com/docs/gitignore). ## `act`'s `.gitignore` feature * `.gitignore` file support: * `.gitignore` (per-directory) support: exists (by default, disable per `--use-gitignore=false`, compare #537) * `.git/info/exclude` support: exists (see #1000) * `core.excludesfile` support: missing (**this feature request** #1160) * git repo index support: exists (we may see it as unconfirmed/regression, compare #912) * git-worktree(1) support: this is a different beast, see #829 (report backstory: #1158)
Author
Owner

@grigorye commented on GitHub (Jun 2, 2022):

Just in case, I feel like basically support for git config is not there: I'm not that interested in support for core.excludesfile per se, rather I'm blocked by no support for http.proxy and the likes.

Update: a partial workaround that seems to work as alternative for a single case of http.proxy in git config, is setting the environment variable, HTTP_PROXY (or HTTPS_PROXY) accordingly.

<!-- gh-comment-id:1145001233 --> @grigorye commented on GitHub (Jun 2, 2022): Just in case, I feel like basically support for git config is not there: I'm not that interested in support for `core.excludesfile` per se, rather I'm blocked by no support for `http.proxy` and the likes. Update: a partial workaround that seems to work as alternative for a single case of `http.proxy` in git config, is setting the environment variable, HTTP_PROXY (or HTTPS_PROXY) accordingly.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#651
No description provided.