<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Gitignore on 每日拍拍</title>
    <link>https://dailypypy.org/tags/gitignore/</link>
    <description>Recent content in Gitignore on 每日拍拍</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>zh-tw</language>
    <copyright>© 2026 每日拍拍</copyright>
    <lastBuildDate>Sat, 21 Nov 2026 12:43:00 +0800</lastBuildDate><atom:link href="https://dailypypy.org/tags/gitignore/index.xml" rel="self" type="application/rss+xml" />
    <follow_challenge>
      <feedId>155076163427069952</feedId>
      <userId>154825760438254592</userId>
    </follow_challenge>
    
    
    <item>
      <title>.gitignore 怎麼寫？別把暫存檔和密碼一起傳上 GitHub</title>
      <link>https://dailypypy.org/learn/gitignore-everyday-guide/</link>
      <pubDate>Sat, 21 Nov 2026 12:43:00 +0800</pubDate>
      
      <guid>https://dailypypy.org/learn/gitignore-everyday-guide/</guid>
      <description>&lt;!---
1440x768
prompt: masterpiece, best quality, highres, clean anime illustration, japanese anime style, soft shading, flat color design, 1girl, black hair, green eyes, white off-shoulder shirt, black short skirt, upper body slight dutch angle, standing with one hand resting on hip and the other making a small friendly wave, confident playful smile, looking at viewer, pastel light mint background, neat composition, detailed eyes, cute and smart vibe, minimal background, polished illustration, no text
negative prompt: worst quality, bad eye, bad hand, extra limbs, manga, multiple views, monochrome, text, signature
dedup note: ../py_dotenv/ teaches loading environment settings; ../streamlit-deploy-secrets/ teaches deployment. Both only mention ignore snippets. This standalone beginner task teaches ignore matching, diagnostics and targeted untracking. ../git-attributes-line-endings/ concerns byte/EOL conversion rather than ignored paths; ../git-sparse-checkout/ concerns selecting tracked working-tree paths.
---&gt;

&lt;h2 class=&#34;relative group&#34;&gt;一. 前言：只是寫個小程式，怎麼多了幾千個檔案？ 
    &lt;div id=&#34;一-前言只是寫個小程式怎麼多了幾千個檔案&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;
    
    &lt;span
        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100&#34;&gt;
        &lt;a class=&#34;group-hover:text-primary-300 dark:group-hover:text-neutral-700&#34;
            style=&#34;text-decoration-line: none !important;&#34; href=&#34;#%e4%b8%80-%e5%89%8d%e8%a8%80%e5%8f%aa%e6%98%af%e5%af%ab%e5%80%8b%e5%b0%8f%e7%a8%8b%e5%bc%8f%e6%80%8e%e9%ba%bc%e5%a4%9a%e4%ba%86%e5%b9%be%e5%8d%83%e5%80%8b%e6%aa%94%e6%a1%88&#34; aria-label=&#34;定位點&#34;&gt;#&lt;/a&gt;
    &lt;/span&gt;        
    
&lt;/h2&gt;
&lt;p&gt;拍拍君剛寫好 &lt;code&gt;app.py&lt;/code&gt;，準備把專案放上 GitHub。
打開變更清單，卻看到整個 &lt;code&gt;.venv&lt;/code&gt;、一堆 &lt;code&gt;__pycache__&lt;/code&gt;，還有本機的 &lt;code&gt;.env&lt;/code&gt;。
真正寫的程式不到十行，等待加入版本控制的檔案卻有幾千個。&lt;/p&gt;
&lt;p&gt;這時候需要的不是一個一個取消勾選，而是一份 &lt;code&gt;.gitignore&lt;/code&gt;。
它告訴 Git：&lt;strong&gt;這些尚未追蹤的檔案，不要在一般新增流程中收進來。&lt;/strong&gt;
今天用一個全新的練習資料夾，完成三件事：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;排除虛擬環境、快取與本機設定。&lt;/li&gt;
&lt;li&gt;確認規則真的命中，而不是憑感覺。&lt;/li&gt;
&lt;li&gt;看懂為什麼「已經加入的檔案」不會自己消失。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;如果你還沒用過 &lt;code&gt;git add&lt;/code&gt; 和 commit，可以先看 &lt;a href=&#34;../git-intro/&#34;&gt;Git 基本操作&lt;/a&gt;。
這篇不需要連上 GitHub，也不用真的放任何密碼。&lt;/p&gt;</description>
      <media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://dailypypy.org/learn/gitignore-everyday-guide/featured.png" />
    </item>
    
  </channel>
</rss>
