gitignore

Gitignore not working

北慕城南 提交于 2019-11-26 09:34:53
My .gitignore file isn't working for some reason, and no amount of Googling has been able to fix it. Here is what I have: *.apk *.ap_ *.dex *.class **/bin/ **/gen/ .gradle/ build/ local.properties **/proguard/ *.log It's in the directory master , which is my git repo. I'm running Git 1.8.4.2 because I'm on a MacBook running OSX 10.8.6. The files/folder in your version control will not just delete themselves just because you added them to the .gitignore . They are already in the repository and you have to remove them. You can just do that with this: ( Remember to commit everything you've

Using git, how do I ignore a file in one branch but have it committed in another branch?

≯℡__Kan透↙ 提交于 2019-11-26 09:33:45
I've got a project that I'm deploying to Heroku . The source code tree includes a bunch of mp3 files (the website will be for a recording project I was heavily involved with). I'd like to put the source code for it up on GitHub , but GitHub has a 300 MB limit on their free accounts. I don't want to use 50 MB of my limit on a bunch of mp3 files. Obviously, I could add them to the .gitignore file to keep them out of my repo. However, I deploy to Heroku using git push heroku . The mp3 files must be present in the branch I push to Heroku so that they get get deployed. Ideally, I'd like to

How to ignore all hidden directories/files recursively in a git repository?

送分小仙女□ 提交于 2019-11-26 09:19:17
问题 I\'d like to have Git ignore all hidden files and directories. i.e. .aptitude .ssh/ .bash_rc config/.hidden Is there a simple rule to cover this without specifically adding each entry? 回答1: Just add a pattern to .gitignore .* !/.gitignore Edit: Added the .gitignore file itself (matters if it is not yet commited). 回答2: .gitignore will only effect files that haven't been 'added' already. To make new .gitignore entries affect all files Make changes to .gitignore git commit -a -m "Pre .gitignore

Difference in the paths in .gitignore file?

為{幸葍}努か 提交于 2019-11-26 09:17:10
问题 I\'ve been using git but still having confusion about the .gitignore file paths. So, what is the difference between the following two paths in .gitignore file? tmp/* public/documents/**/* I can understand that tmp/* will ignore all the files and folders inside it. Am I right? But what does that second line path mean? 回答1: This depends on the behavior of your shell. Git doesn't do any work to determine how to expand these. In general, * matches any single file or folder: /a/*/z matches /a/b/z

How to manage configuration files when collaborating?

雨燕双飞 提交于 2019-11-26 09:07:55
问题 I\'m writing a short script with a few simple variables at the top of the page. I want to work on them with a friend, but we aren\'t sure how to manage the variables needing to be changed after pulling each time for one of us, adding unnecessary junk to git status. I thought about just creating different named branches for each of us, and then the master will just have example usernames set, but it seems silly to have to do all that extra work merging. We could have the variables passed to

git ignore exception

好久不见. 提交于 2019-11-26 08:46:17
问题 I have a gitignore file that makes git ignore *.dll files, and that is actually the behavior I want. However, if I want an exception ( i.e. to be able to commit foo.dll ), how can I achieve this? 回答1: Use: *.dll #Exclude all dlls !foo.dll #Except for foo.dll From gitignore: An optional prefix ! which negates the pattern; any matching file excluded by a previous pattern will become included again. If a negated pattern matches, this will override lower precedence patterns sources. 回答2: Git

What's the difference between Git ignoring directory and directory/*?

两盒软妹~` 提交于 2019-11-26 08:05:04
问题 I\'m confused about what\'s the correct way to ignore the contents of a directory in git. Assume I have the following directory structure: my_project |--www |--1.txt |--2.txt |--.gitignore What\'s the difference between putting this: www And this? www/* The reason I\'m asking this question is: In git, if a directory is empty, git won\'t include such empty directory in repository. So I was trying the solution that is add an extra .gitkeep file under the directory so that it won\'t be empty.

Git excludesfile for a branch

拜拜、爱过 提交于 2019-11-26 07:35:37
问题 I want to ignore certain files within a branch without having to rely on a tracked .gitignore file that will be overwritten during merges with other branches. I’ve closely followed a Stack Overflow answer along with the linked blog post, but my repo doesn’t seem to be recognizing the specified excludesfile in my .git/config . The Git documentation (git-config, gitignore) doesn’t seem to show how to specify and address an excludes file for a specific branch. My .git/config looks like this:

Git is ignoring files that aren't in gitignore

為{幸葍}努か 提交于 2019-11-26 07:26:28
问题 I have a git repository that is ignoring image files as well as a few other files, but my .gitignore file only has it ignoring a config.php file. Is there some global ignore file somewhere that I can\'t seem to find? I have to specify files to add them now, and it\'s giving me this warning: The following paths are ignored by one of your .gitignore files. The contents of my ~/.gitconfig file are only my e-mail address. 回答1: git check-ignore Use git check-ignore command to debug your gitignore

Using .gitignore to ignore everything but specific directories

大城市里の小女人 提交于 2019-11-26 06:58:35
问题 My issue is that I have a bunch of WordPress websites in my git repo, of which I want to selectively commit only the content of my themes folders, while ignoring the rest of the redundant files found in WordPress. I\'ve used .gitignore files to ignore file types before, but can it be used the other way around- that is to ignore everything BUT a certain folder path? root (git repo) - / wordpress - - / (WordPress Site 1)/wp-content/themes - - / (WordPress Site 2)/wp-content/themes - - /