gitignore

Trouble un-ignoring previously ignored files in Git repo

被刻印的时光 ゝ 提交于 2019-11-27 11:02:16
问题 I have a site that has a /sites/default/files/ directory where user content is typically kept. Figuring that I don't need to be tracking this stuff, I added /sites/default/files/ to my .gitignore file. Then I discovered that I also wanted to keep some mostly-permanent uploads in that directory as well. Now it makes more sense to track everything in /sites/default/files/ and exclude undesirable subdirectories, instead of doing it the other way around. The problem is that Git won't stop

How to .gitignore files recursively

六月ゝ 毕业季﹏ 提交于 2019-11-27 11:01:37
问题 I'm trying to avoid the following pattern in my .gitignore file. MyPrject/WebApp/Scripts/special/*.js MyPrject/WebApp/Scripts/special/*/*.js MyPrject/WebApp/Scripts/special/*/*/*.js MyPrject/WebApp/Scripts/special/*/*/*/*.js MyPrject/WebApp/Scripts/special/*/*/*/*/*.js MyPrject/WebApp/Scripts/special/*/*/*/*/*/*.js MyPrject/WebApp/Scripts/special/*/*/*/*/*/*/*.js We tried: MyPrject/WebApp/Scripts/special/**.js MyPrject/WebApp/Scripts/special/**/*.js This however didn't work. This is git on

How to Add Linux Executable Files to .gitignore?

匆匆过客 提交于 2019-11-27 10:39:51
问题 How do you add linux executable files to .gitignore without giving them an explicit extension and without placing them in a specific or /bin directory? Most are named the same as the C file from which they were compiled without the ".c" extension. 回答1: Can you ignore all, but source code files? For example: * !*.c !Makefile 回答2: I would explicitly put them in the project .gitignore. It's not elegant, but I imagine your project doesn't have that many of them. 回答3: Most developers usually have

gitignore does not ignore folder

社会主义新天地 提交于 2019-11-27 10:35:23
In the root of my project I have a foo folder. Inside the foo folder I have a bar folder. I would like to ignore all changes to all files inside my bar folder. I have this in my gitignore : /foo/bar The folder is checked: it exists and it has the files to be ignored. gitignore is commit ted. However, I have a file where I make a moification and is inside my bar folder. When I type git status inside my git bash I see the file which should have been ignored. What could be the reason and how can I successfully ignore all files inside my bar folder? Note, that the files were previously ignored

How do I open source my Rails' apps without giving away the app's secret keys and credentials

谁都会走 提交于 2019-11-27 10:33:48
问题 I have a number of Rails apps hosted on GitHub. They are all currently private, and I often will deploy them from their GitHub repository. I'd like to be able to make some of them open source, just like the ones you can find on http://opensourcerails.com. My question is: How can I make these repositories public without giving away super secret credentials? For example, I can look in /config/initializers/cookie_verification_secret.rb and see the cookie secret for nearly every one of them. I

Recursive git update-index --assume-unchanged

ⅰ亾dé卋堺 提交于 2019-11-27 10:30:06
问题 I'm trying to run the following: git update-index --assume-unchanged myFolderToIgnore Where myFolderToIgnore is a folder. However it fails saying its "unable to mark" it. So I tried: git update-index --assume-unchanged myFolderToIgnore/ Which GIT responds to with Ignoring path myFolderToIgnore/ but doesn't do anything (it still sees my changes and tries to check them in). In the end I had to go in and manually mark each individual file as unchanged. What am I missing here? 回答1: update-index

Git Ignores and Maven targets

流过昼夜 提交于 2019-11-27 10:13:07
Anyone know if it is possible to ignore all the instances of a particular directory in a file structure managed by git. I'm looking to exclude all the 'target' folders in a maven project with a number of submodules. I know I can explicitly exclude each of them in a top level .gitignore, but I'd really like to be able to specify a pattern like **/target/* there to have it automatically ignore the instance in sub directories? Is this possible? baudtack It is possible to use patterns in a .gitignore file. See the gitignore man page . The pattern */target/* should ignore any directory named target

Git: How to remove file from index without deleting files from any repository

流过昼夜 提交于 2019-11-27 10:04:10
When you use git rm --cached myfile it doesn't delete from the local filesystem, which is the goal. But if you've already versioned and committed the file, pushed it to a central repository, and pulled it into yet another repository before using the command, it will delete the file from that system. Is there a way to just remove the file from versioning without deleting it from any filesystem? Edit: Clarified, I hope. I do not think a Git commit can record an intention like “stop tracking this file, but do not delete it”. Enacting such an intention will require intervention outside Git in any

.gitignore exclude files in directory but not certain directories

自古美人都是妖i 提交于 2019-11-27 09:03:03
问题 application/cache/* application/cache/folder/* application/cache/folder/onemorefolder/* This doesn't seem to be working. When I clone the project, there is no "application/cache" folder or "application/cache/folder" folder, etc... I'd like if files in the cache folders weren't cached but folders were, so that the folders permissions transfer and exist. 回答1: Git doesn't track folders, only files, so if you ignore everything in a folder, Git won't have anything to track. You can add a

git still shows files as modified after adding to .gitignore

空扰寡人 提交于 2019-11-27 08:56:50
问题 i'm adding this to .gitignore file .idea/* but anyway the status is: # modified: .gitignore # modified: .idea/.generators # modified: .idea/dovezu.iml # modified: .idea/misc.xml # modified: .idea/workspace.xml what am i doing wrong ? i even added .idea/* to the global ~/.gitignore_global but git status, anyway shows me: # modified: .gitignore # modified: .idea/.generators # modified: .idea/dovezu.iml # modified: .idea/misc.xml # modified: .idea/workspace.xml 回答1: Your .gitignore is working,