I am trying to use git as my VCS for a small project. (Using 2 PCs, both windows)
As I don't like bash I am using gitExtensions, but somehow my .gitignore seems to get ignored by it. This is what my .gitignore looks like:
nbproject/private/
build/
nbbuild/
dist/
nbdist/
nbactions.xml
nb-configuration.xml
build.xml
Now, my folder-structure looks somewhat like this:
E:.
├───lib
│ └───<libary stuff>
└───trunk
├───build
│ ├───empty
│ ├───generated-sources
│ └───web
├───dist
├───nbproject
│ └───private
├───src
│ ├───conf
│ └───java
└───web
Unfortunately it still includes the whole build folder, and every time I build it i get various new edited files in e.g. the build/generated-sources/ or the dist/, or build/web/
I'm quite new to using .gitignore, so please bear with my low knowledge about it.
Thanks and I appreciate the help.
gitignore , nor in the global . gitignore , can be ignored using explicit repository excludes in your_project_directory/. git/info/exclude . This file will not be shared with other developers, and is specific for that single repository.
The easiest and most common way to ignore files is to use a gitignore file. Simply create a file named . gitignore in the repository's root directory. Then, add names and patterns for any files and directories that should not be added to the repository.
Some times, even if you haven't added some files to the repository, git seems to monitor them even after you add them to the . gitignore file. This is a caching issue that can occur and to fix it, you need to clear your cache.
If you want to ignore a file that you've committed in the past, you'll need to delete the file from your repository and then add a . gitignore rule for it. Using the --cached option with git rm means that the file will be deleted from your repository, but will remain in your working directory as an ignored file.
The files that you're trying to ignore may already be under version control. If that's the case, you need to remove them from version control, then make a commit. After that, what's listed in .gitignore
should be properly ignored.
To figure out how to remove files in Git Extensions (v2.48), have a look at the online documentation. Besides, KindDragon mentions, in his comment, a feature recently added, called "Show ignored files", which you might find useful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With