gitignore

Remove file from the repository but keep it locally

半腔热情 提交于 2019-11-27 08:55:53
问题 I have a folder which I'd like to remove in my remote repository. I'd like to delete it, but keep the folder in my computer 回答1: git rm --cached -r somedir Will stage the deletion of the directory, but doesn't touch anything on disk. This works also for a file, like: git rm --cached somefile.ext Afterwards you may want to add somedir/ or somefile.ext to your .gitignore file so that git doesn't try to add it back. 回答2: I would just: Move the folder out of your working tree git rm the folder,

explain gitignore pattern matching

a 夏天 提交于 2019-11-27 08:19:35
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 foolproof way to test gitignore. I checked the documentation . Here is the point it don't understand (this

working with .git/info/exclude too late

让人想犯罪 __ 提交于 2019-11-27 08:01:57
I usually do this: git init git add . git commit . And then I realize that it's about to add my nbproject directory, which I want excluded/ignored. Sometimes, I even check in this directory. Had I added it to .git/info/exclude before running git add., everything works fine (it's excluded). So then I modify .git/info/exclude and then it's too late. git no longer respects changes to .git/info/exclude. So the questions are: How can I get git to take up the changes in the exclude file in the checkin? (I tried running git add . again, which doesn't help) Let's say I check in a directory (or file)

Git is ignoring .idea folder, but that isn't in gitignore

点点圈 提交于 2019-11-27 07:49:47
问题 The problem: I'm on OSX. I have a very small .gitignore file, and I even tried completely deleting the file. Nothing helps. Git doesn't see anything under my .idea directory for intellij. At the very least I want to store .idea/runConfigurations/*. Worse than that, according to this post, all the files in that directory but 1 or 2 should be source controlled. Is there an extra, hidden .gitignore setting somewhere I don't know about? Is there any way to search for and murder it if so? Steps

What should be in my .gitignore for an Android Studio project?

安稳与你 提交于 2019-11-27 06:34:44
问题 What files should be in my .gitignore for an Android Studio project? I've seen several examples that all include .iml but IntelliJ docs say that .iml must be included in your source control. 回答1: Updated to Android Studio 3.0 Please share missing items in comments. A late answer but none of the answers here and here was right on the money for us... So, here's our gitignore file: #built application files *.apk *.ap_ # files for the dex VM *.dex # Java class files *.class # generated files bin/

What to gitignore from the .idea folder?

与世无争的帅哥 提交于 2019-11-27 05:45:10
Possible Duplicate: Intellij Idea 9/10, what folders to check into (or not check into) source control? I started using WebStorm for web development and am not sure what to add and what to exclude from our Git repository. Clearly some files inside the .idea folder are meant to be version controlled like the external library settings ( jsLibraryMappings.xml ) but others will probably change very often and are developer-specific (e.g., workspace.xml ). What is the recommended .gitignore pattern for WebStorm / IntelliJ IDEA? P.S. There are already questions about this but usually focus only on

Apply .gitignore on an existing repository already tracking large number of files

时光毁灭记忆、已成空白 提交于 2019-11-27 05:43:47
I have an existing Visual Studio project in my repository. I recently added a .gitignore file under my project and I assume that tells Git to ignore the files listed in the file. My problem is that all those files are already being tracked and as far as I know Git will not ignore a file that was already tracked before a rule was added to this file to ignore it. It was suggested to use: git rm --cached and manually un-track them but that's going to take me forever to go through them one by one. I thought about deleting the repository and recreating it again but this time with .gitignore file

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

筅森魡賤 提交于 2019-11-27 05:32:04
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 process is actually modifying some tracked files (yes, most likely because someone mistakenly committed

gitignore by file size?

北慕城南 提交于 2019-11-27 05:13:41
问题 I'm trying to implement Git to manage creative assets (Photoshop, Illustrator, Maya, etc.), and I'd like to exclude files from Git based on file size rather than extension, location, etc. For example, I don't want to exclude all .avi files, but there are a handful of massive +1GB avi files in random directories that I don't want to commit. Any suggestions? 回答1: I'm new to .gitignore, so there may be better ways to do this, but I've been excluding files by file size using: find . -size +1G |

Comments in .gitignore?

走远了吗. 提交于 2019-11-27 05:02:00
问题 Can you write comments in a .gitignore file? If so, should the line be preceded with a # or some other indicator? 回答1: Yes, you may put comments in there. They however must start at the beginning of a line. cf. http://git-scm.com/book/en/Git-Basics-Recording-Changes-to-the-Repository#Ignoring-Files The rules for the patterns you can put in the .gitignore file are as follows: - Blank lines or lines starting with # are ignored. […] The comment character is # , example: # no .a files *.a 回答2: Do