只有累積,沒有奇蹟

2018年12月16日 星期日

[VS2017] 如何用 Visual Studio 2017 專案設定 .gitignore

前言
一般在開發的時候,會有一些檔案是不需要 commit 到 Git 版控工具裡面,舉例來說當 VS build 完專案會產生 dll 存放在在 bin 目錄底下,或是 packages 資料夾 ( Nuget 下載的套件 ),甚至一些機密的資料或是 config 檔案,這些內容都不需要 Commit 到 git 中,以上需求都可以透過 .gitignore 定義要忽略的文件或檔案,這篇文章簡單紀錄在Visual Studio 中如何設定 .gitignore 檔案

如何設定
透過 Visual Studio 2017 設定
Step 1. 開啟專案檔,點選 Team Explorer 
    
Step 2. 點選設定

Step 3. 會跳出 Git 設定,選擇存放庫設定


Step 4. 接下來會跳出此 Repo 的 Git 設定,點擊編輯 .gitignore 即可進行調整

加碼 : 如何得知預設的 .gitignore 設定
有一份線上工具,可以根據你的操作系統,IDE,語言生成相關 .gitignore 設定檔案
可以參考 : http://www.gitignore.io/

















參考
gitignore
.gitignore for Visual Studio Projects and Solutions
有些檔案我不想放在 Git 裡面…

Related Posts:

  • [Nuget] 使用 NuGet Package Explorer 製作 Nuget 套件問題  在上一篇介紹了如何架設公司內部 nuger server,架設完畢後會使用 nuget push 指令將開發完 Library 上傳到公司內部 nuget server 上,但每次都要透過手動打指令 push 難道沒有更快的方法了嗎 ? 今天就要來介紹一套好用的工具 Nuget Package Explorer 可以省去打指令的動作,透過 GUI 的介面將開發好的 Library 上傳到共用或是私人架設的 nuget … Read More
  • [Chocolatey] Windows 套件管理工具 - Chocolatey 初體驗前言  之前在外面上課時就聽過講師介紹 chocolatey 套件管理工具,但當時趕專案上線就沒有再深入研究,直到最近要在公司筆電安裝軟體才想起 Windows 有此神奇的套件管理神器,今天就針對此神器筆記安裝與功能介紹,避免初老症狀病發還要再次請教 google 大神。  Chocolatey 是什麼 可以吃嗎 ? 在過去在 Windows 安裝軟體應用程式時,需要下載安裝檔與使用其軟體安裝流程步驟等各種 GUI 介面… Read More
  • [Nuget] The term 'nuget.exe' is not recognized as the name of a cmdlet, function, script file, or operable program問題  最接開發完 Libary 專案要上傳到 nuget server 時,要將 package 檔案透過指令 push 噴 error 錯誤訊息 nuget.exe : The term 'nuget.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the … Read More
  • [Chocolatey] Chocolatey 常用指令大全 Chocolatey 指令大全  這篇文章整理 Chocolatey 在使用時常用到的指令,方便自己後須用到或初老症狀病發還要再次 google Search 搜尋  List 列出清單 Install 安裝 Upgrade 升級 Uninstall 移除 Config 設定 Help    Commands  » Search Package  // search comman… Read More
  • [Chocolatey] 設定 Package 安裝路徑問題  在前一篇介紹 Chocolatey 使用初體驗,文章最後 demo 下載 Winrar 軟體顯示其強大威力,當使用過 Chocolatey 下載 package 後預設路徑是在 C 槽底下,由於個人習慣安裝與下載資料夾都在另外的 D 槽環境,今天要分享的是如何修改 chocolatey 預設下載路徑的設定方式。  設定安裝路徑 Chocolatey 預設下載路徑為 C:\Users\… Read More

0 意見:

張貼留言

Copyright © 2025 m@rcus 學習筆記 | Powered by Blogger

Design by Anders Noren | Blogger Theme by NewBloggerThemes.com