Skip to content
  • Home
  • About
  • No Access
  • Privacy Policy
Bits of .NET
Bits of .NET
  • C#
  • Asp.Net Core
  • SQL
  • Windows
  • WordPress
  • AI
  • JavaScript
  • CSS
  • MORE
    • HTML
    • Ajax
    • Git
    • Docker
    • Kubernetes
    • Photoshop
    • Visual Studio

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • C#
  • Asp.Net Core
  • SQL
  • Windows
  • WordPress
  • AI
  • JavaScript
  • CSS
  • MORE
    • HTML
    • Ajax
    • Git
    • Docker
    • Kubernetes
    • Photoshop
    • Visual Studio
Git

Git: Fix Attributes Export-Ignore Missing From a Release Archive

- 30.11.26 - ErcanOPAK

🔀 Fix Attributes Export-Ignore Missing From a Release Archive

Marking a path export-ignore in .gitattributes tells git archive to leave it out of the generated zip or tarball, which is exactly how most projects keep test fixtures, CI config, and internal docs out of a public release tarball — but that rule is read from the committed .gitattributes file at the commit or tag being archived, so a rule added only in a later commit has no effect on an archive generated from an older tag that predates it.

🔎 The Problem

.gitattributes (current HEAD):
  tests/        export-ignore
  .github/      export-ignore

$ git archive --format=zip v2.3.0 -o release.zip
# v2.3.0 was tagged BEFORE the export-ignore rules were added,
# so tests/ and .github/ are still bundled into release.zip

✅ Fix: Backfill the Rule or Re-Tag, Don’t Just Update HEAD

  • If the old tag can still be re-cut, add the export-ignore rules, commit, and move the tag to point at the new commit — git archive reads attributes from the exact ref being archived, not from HEAD.
  • If the tag is already published and can’t move, generate that specific release’s archive manually with an explicit exclude list instead of trusting git archive to apply attributes the tagged commit never had.
  • Going forward, add export-ignore rules as part of the normal repository setup rather than as an afterthought, so every future tag inherits them automatically with no manual archive step needed.

Export-ignore isn’t a setting on your repository — it’s a fact about one specific commit, and git archive only ever reads it from the commit you’re actually archiving.

— Version Control Tip

Related posts:

Git: Fix a Shallow Clone Failing to Push Because the Server Rejects a History That's Missing Commits...

Git: Fix a Shallow Clone Failing to Push Because the Server Rejects a History That's Missing Commits...

Git: Fix 'Your Branch and Origin Have Diverged' Without Losing Either Side's Commits

Git: Fix 'Your Branch and Origin Have Diverged' Without Losing Either Side's Commits

Git: Fix a Worktree That Refuses to Check Out a Branch Already Checked Out Elsewhere

Git: Fix a Worktree That Refuses to Check Out a Branch Already Checked Out Elsewhere

Views: 2
Found this useful? Share it
XLinkedInWhatsApp

Post navigation

Visual Studio: Fix IntelliSense Crashing on a Huge Razor File
WordPress: Fix Emoji Shortcodes Rendering as Boxes in RSS Feeds

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Most Read

  1. 01How to make theater mode the default for Youtube 1,079 views
  2. 02How to add default value for Entity Framework migrations for DateTime and Bool 996 views
  3. 03Get the User Name and Domain Name from an Email Address in SQL 995 views
  4. 04Get the First and Last Word from a String or Sentence in SQL 873 views
  5. 05How to select distinct rows in a datatable in C# 866 views
  6. 06How to enable, disable and check if Service Broker is enabled on a database in SQL Server 671 views
  7. 07Add Constraint to SQL Table to ensure email contains @ 629 views
  8. 08Average of all values in a column that are not zero in SQL 584 views
  9. 09How to use Map Mode for Vertical Scroll Mode in Visual Studio 561 views
Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
Back to top
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com