gitignore

What is .gitignore exactly?

不想你离开。 提交于 2019-12-17 07:00:35
问题 I just created a Github repository and was wondering what the .gitignore file was for. I started by not creating one, but added one due to the fact that most repositories have one. Do I need to have one? Can/do I just ignore it, or does it have a use? I did some research on the subject but couldn't find a concrete explanation. 回答1: .gitignore tells git which files (or patterns) it should ignore. It's usually used to avoid committing transient files from your working directory that aren't

What is .gitignore exactly?

巧了我就是萌 提交于 2019-12-17 07:00:19
问题 I just created a Github repository and was wondering what the .gitignore file was for. I started by not creating one, but added one due to the fact that most repositories have one. Do I need to have one? Can/do I just ignore it, or does it have a use? I did some research on the subject but couldn't find a concrete explanation. 回答1: .gitignore tells git which files (or patterns) it should ignore. It's usually used to avoid committing transient files from your working directory that aren't

Git: Ignoring Version-Controlled Files

谁都会走 提交于 2019-12-17 06:28:09
问题 The .gitignore file is very useful in ignoring some of the files that we don't want to control. Unfortunately, it cannot be used when the file is already under version control. For example, my .gitignore (which is already added to git) file might be different than what my coworker wants it to be (e.g. I want to ignore Vim files). Whenever I make changes to this file, git shows it as a modified file. So my questions: Is there any way to ignore changes for a certain file, which is already

Git: Ignoring Version-Controlled Files

╄→гoц情女王★ 提交于 2019-12-17 06:28:02
问题 The .gitignore file is very useful in ignoring some of the files that we don't want to control. Unfortunately, it cannot be used when the file is already under version control. For example, my .gitignore (which is already added to git) file might be different than what my coworker wants it to be (e.g. I want to ignore Vim files). Whenever I make changes to this file, git shows it as a modified file. So my questions: Is there any way to ignore changes for a certain file, which is already

Best practices for adding .gitignore file for Python projects? [closed]

吃可爱长大的小学妹 提交于 2019-12-17 05:33:58
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 12 months ago . I'm trying to collect some of my default settings, and one thing I realized I don't have a standard for is .gitignore files. There's a great thread showing a good .gitignore for Visual Studio projects, but I don't see many recommendations for Python and related tools (PyGTK

Git ignore sub folders

风格不统一 提交于 2019-12-17 05:16:09
问题 I have a lot of projects in my .Net solution. I would like to exclude all "bin/Debug" and "bin/Release" folders (and their contents), but still include the "bin" folder itself and any dll's contained therein. .gitignore with "bin/" ignores "Debug" and "Release" folders, but also any dll's contained in the "bin" folder. "bin/Debug" or "bin/Release" in the .gitignore file does not exclude the directories, unless I fully qualify the ignore pattern as "Solution/Project/bin/Debug" - which I don't

How to exclude file only from root folder in Git

两盒软妹~` 提交于 2019-12-17 04:13:36
问题 I am aware of using .gitignore file to exclude some files being added, but I have several config.php files in source tree and I need to exclude only one, located in the root while other keep under revision control. What I should write into .gitignore to make this happen? 回答1: From the documentation: If the pattern does not contain a slash /, git treats it as a shell glob pattern and checks for a match against the pathname relative to the location of the .gitignore file (relative to the

How do I tell Git to ignore everything except a subdirectory?

删除回忆录丶 提交于 2019-12-17 00:46:33
问题 I want to ignore all files in my repository except those that occur in the bin subdirectory. I tried adding the following to my .gitignore : * !bin/* This does not have the desired effect, however: I created a new file inside of bin/ , but doing git status still shows nothing to commit (working directory clean) . Any suggestions? 回答1: This ignores root files & root directories, then un-ignores the root bin directory: /* /*/ !/bin/ This way you get all of the bin directory, including

.gitignore and “The following untracked working tree files would be overwritten by checkout”

房东的猫 提交于 2019-12-17 00:23:04
问题 So I added a folder to my .gitignore file. Once I do a git status it tells me # On branch latest nothing to commit (working directory clean) However, when I try to change branches I get the following: My-MacBook-Pro:webapp marcamillion$ git checkout develop error: The following untracked working tree files would be overwritten by checkout: public/system/images/9/thumb/red-stripe.jpg public/system/images/9/original/red-stripe.jpg public/system/images/8/thumb/red-stripe-red.jpg public/system

.gitignore and “The following untracked working tree files would be overwritten by checkout”

别等时光非礼了梦想. 提交于 2019-12-17 00:21:54
问题 So I added a folder to my .gitignore file. Once I do a git status it tells me # On branch latest nothing to commit (working directory clean) However, when I try to change branches I get the following: My-MacBook-Pro:webapp marcamillion$ git checkout develop error: The following untracked working tree files would be overwritten by checkout: public/system/images/9/thumb/red-stripe.jpg public/system/images/9/original/red-stripe.jpg public/system/images/8/thumb/red-stripe-red.jpg public/system