gitignore

.gitignore NuGet exclude packages/ include packages/repositories.config

萝らか妹 提交于 2019-12-03 00:44:04
问题 I'm trying to create a .gitignore for a Visual Studio project that uses NuGet. It currently contains: \packages/* !packages/repositories.config This does not ignore anything in the folder. Everything gets staged on an add. I have also tried: packages/ !packages/repositories.config This ignores everything in the packages folder and does not include the packages/repositories.config. What am I doing wrong? 回答1: /packages/ !packages/repositories.config You can also add a .gitignore in the

.gitignore file, where should I put it in my xcode project?

北城以北 提交于 2019-12-03 00:22:13
问题 I want git to ignore my UserInterfaceState.xcuserstate file in my XCode4 project, but where should I put the .gitignore file?, is it inside the .git folder? or out? The .git is in same folder with the ProjectName.xcodeproj file 回答1: You can have a .gitignore in every single directory of your project. However, the best practice is to have one single .gitignore file on the project root directory, and place all files that you want to ignore in it, like this: ignoredFile.whatever ignoredDirectory

.gitignore not ignoring .idea path

只谈情不闲聊 提交于 2019-12-03 00:10:40
问题 What am I missing that needs to be done in order to get git to ignore my .idea/ path? ctote@ubuntu:~/dev/1$ git status On branch master Your branch is up-to-date with 'origin/master'. Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: .idea/.name modified: .idea/misc.xml modified: .idea/modules.xml modified: .idea/vcs.xml modified: .idea/workspace.xml modified: src

Can't ignore UserInterfaceState.xcuserstate

柔情痞子 提交于 2019-12-03 00:00:06
问题 I'm using Git for Xcode 4 project version control. I've explicitly added ProjectFolder.xcodeproj/project.xcworkspace/xcuserdata/myUserName.xcuserdatad/UserInterfaceState.xcuserstate to .gitignore , but Git it won't ignore it. Any ideas why this is so? 回答1: Git is probably already tracking the file. From the gitignore docs: To stop tracking a file that is currently tracked, use git rm --cached . Use this, replacing [project] and [username] with your info: git rm --cached [project].xcodeproj

Why is git ignoring my changed file?

萝らか妹 提交于 2019-12-02 22:56:54
I make an arbitrary change to a file within my git working directory. git status does not recognized that the file has changed. git add /path/to/file has no effect. git add -f /path/to/file has no effect. git status /path/to/file shows the file as in the 'changes to be committed' bucket. I removed my .gitignore file, just to be sure. No change to any of the above behaviors. I have done git reset --hard , re-made my change. No change to any of the above behaviors. What could be going on here? Tim Henigan There are two general reasons why Git will ignore a file: gitignore and submodules . To be

Pushing .gitignore files to specific remote

◇◆丶佛笑我妖孽 提交于 2019-12-02 22:43:18
I made a Sinatra app, that will be hosted on Heroku, and the source will be up on GitHub. The problem is that i have a file with API keys, that is currently in .gitignore. Is there a way, that I can push my repo to heroku with the key file and exclude the file when pushing to GitHub? Thanks in advance! It is possible to maintain a separate branch just for deployment, but it takes much discipline to maintain it properly: Add a commit to a production branch that adds the config file ( git add -f to bybass your excludes). To update your production branch, merge other branches (e.g. master ) into

git add adding ignored files

一笑奈何 提交于 2019-12-02 19:58:42
I'm trying to remove a previously tracked directory from git, which works, but it's being added back with each subsequent git add . , git add -A , etc. Here's what I've done: Add to .gitignore in root of project: node_modules Run the following: git rm -r --cached node_modules git commit -a -m "removed node_modules" git push origin master So far so good, this removes the directory from the remote repository. The problem is when I later run git status it tells me the node_modules directory is untracked and keeps adding it back on future commits. What am I missing and/or how do I find the root of

How to I add something to the .gitignore so that the match is not recursive?

廉价感情. 提交于 2019-12-02 19:55:42
How to I add something to the .gitignore so that the match is not recursive? For example, I wish to ignore the directory foo and the file bar.txt in the current directory, but not any that exist in subdirectories. I have tried this for my .gitignore file: foo/ bar.txt But unfortunately git applies this recursively, so that otherdir/bar.txt and otherdir/foo/ also get ignored, which is not what I want. (Is there a command in git that shows me all ignored files, and reference the .gitignore file that is responsible for the file being ignored? This would be useful for debugging.) The solution is

Should the package-lock.json file be added to .gitignore? [duplicate]

亡梦爱人 提交于 2019-12-02 19:02:44
This question already has an answer here: Do I commit the package-lock.json file created by npm 5? 10 answers To lock the versions of dependencies that are installed over a project, the command npm install creates a file called package-lock.json . This was made since Node.js v8.0.0 and npm v5.0.0 , as several of you might know. Despite of Node.js and npm recommendations about committing this file, several concerns regarding when you should avoid to do it, are also an option. Typically we commit in our projects, nevertheless, it is a peculiar question. While we should commit the package-lock

Meaning of leading slash in `.gitignore` file

与世无争的帅哥 提交于 2019-12-02 18:52:20
If I put a pattern in a .gitignore file with a leading slash, does the slash refer to the directory in which the .gitignore file is located, or does it refer to the root of the whole repository? (The man pages I have found have hidden this information carefully.) This is the documentation text : A leading slash matches the beginning of the pathname. For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c". These are my guesses: If you use an in-repository- .gitignore , the directory in which the .gitignore is located - it is not really useful to make it relative to the repository