0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[GitHub] gitでpushしたくないファイルを外す (git ignore)

Posted at

git ignore とは

gitの管理下に置きたくないファイル(パスワードなどのセキュリティー上、共有したくないファイルなど)を git ignore という機能を使って、gitの管理外に置くファイルを設定することができます。

git ignore の使用方法

例えば sample というディレクトリ内で、gitの管理下に置きたくない sample.html というファイルを作成したとします。
sampleディレクトリ内に .gitignore というファイルを作成し、.gitignore ファイルの中にgitの管理下に置きたくないファイル(今回の場合は sample.html )を指定していきます。

gibo を使って.gitignoreを作成する

gibo とは

.gitignore を自動で作成してくれる機能です。

インストール

$ brew install gibo

例えばRailsで作成するとします。
.gitignore を作成したいディレクトリに移動して以下のコマンドを実行します。
(Railsの .gitignore の中身を作成して、それを .gitignore に入れ込むコマンドです。)

$ gibo Rails

$ gibo Rails >> .gitignore

Rails以外の言語でも作成可能です。↓

$ gibo list

Actionscript		Anjuta			Jekyll
Ada			Ansible			JENKINS_HOME
Agda			Archives		Joomla
Android			Backup			Julia
AppceleratorTitanium	Bazaar			KiCad
AppEngine		BricxCC			Kohana
ArchLinuxPackages	Calabash		Kotlin
Autotools		Cloud9			LabVIEW
C++			CodeKit			Laravel
C			CVS			Leiningen
CakePHP			DartEditor		LemonStand
CFWheels		Diff			Lilypond
ChefCookbook		Dreamweaver		Lithium
Clojure			Dropbox			Lua
CMake			Eclipse			Magento
CodeIgniter		EiffelStudio		Maven
CommonLisp		Emacs			Mercury
SAM			Ensime			MetaProgrammingSystem
Bazel			Espresso		Nanoc
InforCMS		FlexBuilder		Nim
Kentico			GPG			Node
Phoenix			Images			Objective-C
AtmelStudio		JDeveloper		OCaml
esp-idf			JEnv			Opa
IAR_EWARM		JetBrains		OpenCart
Exercism		Kate			OracleForms
GNOMEShellExtension	KDevelop4		Packer
Hugo			Lazarus			Perl
JBoss4			LibreOffice		Phalcon
JBoss6			Linux			PlayFramework
Cordova			LyX			Plone
Meteor			macOS			Prestashop
NWjs			MATLAB			Processing
Vue			Mercurial		PureScript
Snap			Metals			Python
Logtalk			MicrosoftOffice		Qooxdoo
OpenSSL			ModelSim		Qt
Bitrix			Momentics		R
CodeSniffer		MonoDevelop		Rails
Drupal7			NetBeans		Raku
Jigsaw			Ninja			RhodesRhomobile
Magento1		NotepadPP		ROS
Magento2		Octave			Ruby
Pimcore			Otto			Rust
ThinkPHP		Patch			Sass
Puppet			PSoCCreator		Scala
JupyterNotebooks	PuTTY			Scheme
Nikola			Redcar			SCons
Racket			Redis			Scrivener
Red			SBT			Sdcc
Splunk			SlickEdit		SeamGen
Xilinx			Stata			SketchUp
Composer		SublimeText		Smalltalk
Concrete5		SVN			Stella
Coq			SynopsysVCS		SugarCRM
CraftCMS		Tags			Swift
CUDA			TextMate		Symfony
D			TortoiseGit		SymphonyCMS
Dart			Vagrant			Terraform
Delphi			Vim			TeX
DM			VirtualEnv		Textpattern
Drupal			Virtuoso		TurboGears2
Eagle			VisualStudioCode	Typo3
Elisp			WebMethods		Umbraco
Elixir			Windows			Unity
Elm			Xcode			UnrealEngine
EPiServer		XilinxISE		VisualStudio
Erlang			Go			VVVV
ExpressionEngine	Godot			Waf
ExtJs			Gradle			WordPress
Fancy			Grails			Xojo
Finale			GWT			Yeoman
ForceDotCom		Haskell			Yii
Fortran			Idris			ZendFramework
FuelPHP			IGORPro			Zephir
Gcov			Java
GitBook			JBoss
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?