gitignore

Is there a way to tell git to only include certain files instead of ignoring certain files?

谁说胖子不能爱 提交于 2019-12-17 21:28:23
问题 My programs generally generate huge output files (~1 GB) which I do not want to be backing up to the git repository. So instead of being able to do git add . I have to do something like git add *.c *.cc *.f *.F *.C *.h *.cu which is a little bit cumbersome... I feel fairly confident I could write a quicky perl script ls the directory contents into .gitignore and then remove files based on a .gitinclude (or some similar name) file, but that seems a little too hackish. Is there a better way?

Should you commit .gitignore into the Git repos?

喜夏-厌秋 提交于 2019-12-17 21:24:14
问题 Do you think it is a good practice to commit .gitignore into a Git repo? Some people don't like it, but I think it is good as you can track the file's history. Isn't it? 回答1: Normally yes, .gitignore is useful for everyone who wants to work with the repository. On occasion you'll want to ignore more private things (maybe you often create LOG or something. In those cases you probably don't want to force that on anyone else. 回答2: You typically do commit .gitignore . In fact, I personally go as

git ignore exception not working as desired

你说的曾经没有我的故事 提交于 2019-12-17 18:41:04
问题 WinXP + mysisGit1.7 In my .gitignore file, but still can't see Demos/path/to/file/file.cpp being tracked by git. I have below entries: Demos/ !Demos/path/to/file/file.cpp The absolute path is: c:\Project\Demos\path\to\file\file.cpp What could be wrong? Please help, thanks. EDIT: I found the way how mysisGit .gitignore work on WindowsXP can only ignore certain type of file, then exclude some files with same type. For example: *.bak !tracking.bak !/path/to/file/tracking2.bak It doesn't work

Telling git to ignore symlinks

会有一股神秘感。 提交于 2019-12-17 17:55:09
问题 This question has appeared in similar forms here and here, but they don't seem to match up with what I'm looking for. I'm making a project in StaticMatic, a Ruby static site generator. Basically, it's just a src/ directory with Haml templates, Sass, and CoffeeScript. StaticMatic provides a development server to keep compiling these into a static site, as well as a build command that generates the static site in build/. My modification to StaticMatic is to allow the addition of src/_modules

Unignore subdirectories of ignored directories in Git

无人久伴 提交于 2019-12-17 15:35:57
问题 Let's say I have ignored a directory, but I want to unignore specific subdirectories therein. So I have the setup: /uploads/ /uploads/rubbish/ /uploads/rubbish/stuff/KEEP_ME/ /uploads/foo/ /uploads/foo/bar/lose/ And I want to ignore everything but the KEEP_ME directory. I would hope the ignore would look something like: /uploads/* !/uploads/rubbish/stuff/KEEP_ME/ But that's not working, and neither are several permutations on the same theme. One that does work is /uploads/**/**/**/ !/uploads

.gitignore files added inside Git submodules

蹲街弑〆低调 提交于 2019-12-17 15:17:23
问题 I recently reorganized my dotfiles to live inside a Git repository at ~/Dropbox/dotfiles and I'm using pathogen to bundle all Vim addons inside ~/Dropbox/dotfiles/home/.vim/bundle . These addons were added as Git submodules. Now the problem is, when I run Vim, it automatically generates the documentation for all addons and puts them inside each submodule directory. This adds untracked content to the submodules, which I'd like to avoid. ruby-1.8.7-p330@gs ~/Dropbox/dotfiles ‹master*› $ git st

explain gitignore pattern matching

我是研究僧i 提交于 2019-12-17 09:40:01
问题 I have the following directory tree: > #pwd is the repo > tree -a . ├── .git │ |..... ├── .gitignore ├── README.md ├── f1.html ├── f2.html ... and some more html ├── images │ └── river.jpg > I also have the following in my .gitignore : > cat .gitignore * !*.html !images/*.* > I would like all files in the images directory to be included in the repo. But that is not happening. I got it to work using the following in gitignore: * !*.html !images* !*.jp*g What is happening here? Is there a

Using Git to work with subversion: Ignoring modifications to tracked files

别说谁变了你拦得住时间么 提交于 2019-12-17 07:41:22
问题 I am currently working with a subversion repository but I am using git to work locally on my machine. It makes work much easier, but it also makes some of the bad behavior going on in the subversion repo quite glaring and that creates problems for me. There is a somewhat complex local build process after pulling down the code and it creates (and unfortunately modifies) a number of files. Obviously these changes are not meant to be committed back to the repository. Unfortunately the build

Git - Creating a .gitignore file

陌路散爱 提交于 2019-12-17 07:19:33
问题 I'm looking to create a .gitignore file so certain files are do not get checked in to the repository. Does anyone have a guide on how and where to place this file? I have tried placing it in my working directory, ran git status and it is still picking up on the files I would like it to ignore. I used this .gitignore file I have found: ################### # compiled source # ################### *.com *.class *.dll *.exe *.pdb *.dll.config *.cache *.suo # Include dlls if they’re in the NuGet

Git - Creating a .gitignore file

∥☆過路亽.° 提交于 2019-12-17 07:19:10
问题 I'm looking to create a .gitignore file so certain files are do not get checked in to the repository. Does anyone have a guide on how and where to place this file? I have tried placing it in my working directory, ran git status and it is still picking up on the files I would like it to ignore. I used this .gitignore file I have found: ################### # compiled source # ################### *.com *.class *.dll *.exe *.pdb *.dll.config *.cache *.suo # Include dlls if they’re in the NuGet