How to ignore .idea folder and all its contents in Rubymine when it's never been tracked? - gitignore

I'm trying to ignore the .idea/ folder created by Rubymine by default as not everyone in this project is using this IDE, but I can't seem to achieve it.
So far I've tried to ignore it from the gitignore_global, as I won't be commiting this folder in any of my projects; and also from Rubymine settings as shown below, but not of them seem to be working. Maybe I'm not using the correct line in the gitignore?
My gitignore_global has only one line: .idea/
It is properly configured as I can see this on the .gitconfig file (and the path matches):
[core]
excludesfile = C:\\Users\\izamudio\\.gitignore_global
I have also tried adding the folder to Rubymine Ignored Files as "Ignore all files under" and selecting the folder path.
I expect the file to not show on the untracked files when I use the git status command in the rubymine terminal, but I keep getting:
Untracked files:
(use "git add <file>..." to include in what will be committed)
.idea/
nothing added to commit but untracked files present (use "git add" to track)
Am I missing something here? Is it being ignored but the rubymine terminal is showing me otherwise?
I've also tried **/.idea/ and .idea/* but neither of this options seems to do the job.
IMPORTANT EDIT:
After some help from JetBrains support I realized I had my path wrongly configured. The gitignore_global file was missing the dot at the beginning for some reason, so the path in the .gitconfig was not correct. After changing the name of the file from gitignore_global to .gitingore_global everything is working properly.

Related

Visual Studio Code source control full of 'changes' I was not aware of

How do I get rid of these 'changes' on Visual Studio Code? There are over thousands of files and I was not aware of these changes since I installed vs code on my MacBook. I tried git reset --hard on the terminal, but nothing has happened. I also do not recall having these files on my laptop and VS Code cannot even open these files. VS Code also failed to notify me of these 'changes'. Whenever I try to delete all the files, it says git: fatal: you are on a branch yet to be born
See screenshot below:
All of these "changes" are most likely do to you initializing git in a folder with lots of settings and configuration folders. For example, in the screenshot, I can see that most of the "changes" are from .eclipse folder, a folder Eclipse uses to store configurations. You usually cannot see these folders, because they are "hidden" folders.
Solution 1
The first solution is to add a .gitignore file, to ignore all of those unnecessary folders. To do this, just add a file named .gitignore to the current folder. Then in that file, put a list of all of the folders to be ignored. For example(Go through the list of "changes" and add more folders):
/.eclipse
Solution 2
The other solution to seeing these changes is just deleting the .git folder. You can't see this folder by default, because it is a hidden folder. To see this, you have to go to Finder, and press Command + Shift + .. After you see the .git folder, you can just delete it. The changes should now go away.

How to hide ignored files in GitKraken?

so I have updated my version of IntelliJ and Jetbrains decided to create new files and folders on my code folder. (see screenshot below)
I don't really want Jetbrains/IntelliJ clogging up my repo so I decided to add this entry on the .gitignore on the parent folder (e.g. /Users/myuser/Documents/myrepo/.gitignore)
##########################
## Jetbrains/IntelliJ
##
.idea/
.idea_modules/
*.iml
My problem with Gitkraken is that it continues to show all files and folder (as unstaged) inside "/Users/myuser/Documents/myrepo/.idea" even after I restart the app. I'm not sure if this matters but I am using the Gitkraken macOS version.
Some things to try:
Commit your .gitignore first. (Just a guess)
There is an option in GitKraken to ignore files individually, Right-Click (on the unstaged file) -> Ignore. This will add it to .gitignore.
The best way is to use a global ignore file like what is demonstrated here
GitKraken reads the global ignore file as well as the ignore files in the repo.
It does require a little bit of command line use but not much.
create a file in your home directory touch ~/.global_gitignore
add things like the .idea and other things in that file you never want in any repos (including OS specific things) see https://github.com/github/gitignore for many helpfil things to add
run the following command git config --global core.excludesfile ~/.global_gitignore
Enjoy never needing to exclude them from your repos again.

how to rollback the ignore state of a file/folder in git using eclipse

accidently I set the ignore state for a folder in GIT in eclipse.
context-menu on the folder -> team -> ignore.
How can I activate this folder for GIT again ?
I guess it must be team -> add to index, but this doesn't work for me.
any help ?
Click Ctrl+shift+R and type .gitignore in eclipse.
Open the .gitignore file of respective project.
All the ignored file's path will be displayed here.
Now remove the paths of files which you want to unignore and save it.
Again the files will be back to its original stage and can be added to staging area.
Steps to make file unAssumed ignore
If you don't want your files to be ignored then do the following
Go to the file you don't want to be ignored and rightclick it --> Team --> Advanced --> No Assume Unchanged
Please find the same in image
See this bug right now there is no way to find all ignored resource in a git repo using EGIT.
When you do Team context-menu on the folder -> team -> ignore it will automatically create a .gitignore file inside the parent folder and this file is added automatically to git index and will be shown in git staging view.
After committing this file it is difficult to find all ignored resources in a given git repo. Go to your file explorer and search for all .gitignore files inside a git repo and view their content.
In the base directory of the git project, there will be a file called .gitignore (Note the dot at the start of the filename).
This file lists all the files, directories etc that are ignored by git.
Simply edit that file, removing the line which corresponds to the folder you accidentally added.

A folder is mysteriously added into my .gitignore file

I have an Eclipse project which contains only a single folder "MyFolder" containing a LaTeX file "myfile.tex". For some reason, whenever I refresh the project or save a file, the following line is added to the .gitignore file at the root of my project:
/MyFolder
I.e., someone mysteriously tells GIT to ignore the entire folder which contains my tex file. I suspect it's the tex plugin doing this. But why? How can I prevent this?
Try to:
Team → Git → Projects and unmark:
"Automatically ignore derived resources by adding them to .gitignore".

Git shows files changed, but EGit does not

Git noob here. Having a hard time figuring out why git shows some files changed, while Eclipse EGit does not.
When I use EGit within Eclipse and view a project, it shows no files changed. There is no little caret next to each file. When I use Git for Windows, or go to the command line and type "git status", it shows that all the files have been modified. When I type "git diff" it shows two different versions of a file, first red, then green, and there appears to be some whitespace differences, but I can't be sure, and I can't figure out how the whitespace changed in every file in the project. (Something here doesn't add up.) "git diff -w" returns nothing. "git config --global apply.whitespace nowarn" does nothing.
I might be having a basic conceptual problem with git.
In any case, why do EGit and the git command line show different results?
EGit understands the notion of Derived resources (e.g. used for generated .class files in JDT). In other words, files in derived resources are not added to version control by default in EGit. However, the command line git client does not know these markers, but relies on .gitignore files to avoid checking in generated files.
To check whether your problematic files are derived, open the file properties dialog (right click on the file in the explorer, and select Properties...), and on the Resources page check for the Derived checkbox (it should be around the middle of the dialog).
It turns out that git is playing games with newlines. It's inexplicable. Bottom line: EGit and the git command line cannot both be used on a Windows box. To get consistency, you have to use one or the other.