how to rollback the ignore state of a file/folder in git using eclipse - 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.

Related

Adding a File or Folder to a Git Repo in Eclipse

I want simply add a new File or Folder to an existing Repo in my Eclipse.
I tried the following (add index on the file and folder), but nothing happens.
Can someone help me.
In Git, a new file must first be added to the index (also called staging area) and then committed before the file becomes part of the history:
Add files:
Right-click and choose Team > Add to Index or
in the Git Staging view move the file from Unstaged Changes down to Staged Changes
Commit files: In the Git Staging view enter a Commit Message and click Commit
Result: In the History view a new commit containing the files is shown.
Please note in Git (in contrast to e.g. SVN) only files, but not empty folders can be committed.
Check the properties on that folder to get its path.
Switch to command line, and do a git status (if you have Git installed), to check if the folder and its content is actually in a Git repo (or if only "src" is):
Chec at least if you see a .git folder above the folder you want to add to the index, you should be able to do so from Eclipse.
But if not, that would explain why adding it does nothing.

Eclipse Oxygen - Git Staging NOT Showing File Under Dot Folder

I have a project in Eclipse Oxygen that uses Git. When a file is created or edited it shows in the Unstaged Changes list on the Git Staging View. This allows you to drag the file to the Staged Changes list and then it can be committed.
I needed to create a folder named .sti directly under the project folder and then a folder named bin under that, like this:
project/.sti/bin
Then I had to create a file called assemble in the .stl/bin folder.
The problem is that the file called assemble does NOT show in the Unstaged Changes list. Therefore I cannot stage and commit it.
Is there any way of getting this file to appear?
I'm sure that the .sti folder is the cause of the problem.
Any ideas or help would be much appreciated...
In the end I deleted the .gitignore file in the project folder and recreated it. Upon refreshing the project in Project Explorer, the changed file appeared in the Unstaged Changes.
This was rather strange as the original .gitignore did not specify: .sti

How to ignore files via GUI in Gitkraken?

I come from SourceTree to board the GitKraken hype train. It has always been pretty easy to ignore files within ST. Just right-click on a file in the unstaged container and you've all the options. You can ignore the files directly, each file beneath a specific folder etc. (so, all the .gitignore stuff from within the GUI =)).
However, I can't find a similar feature in GitKraken. Does anybody know how I can ignore files via the GUI of GitKraken?
Please note: This is not a git question. I absolutely know in depth how ignoring files in Git work. But that's not the topic whatsoever. This is just a trivial GitKraken support question.
Currently there isn't an option to ignore a file through the GitKraken GUI.
If you check their post on twitter this is planned to be implemented soon and it will be in their release notes once this is completed.
UPDATE (26.01.2017.):
Version 2.0.0 brings the .gitignore option to the list of functionalities. You can now select a file or folder in the file staging area, and add to the .gitignore file on the fly. Right-click and select Ignore. From there, you can:
Add that specific file to .gitignore
Add all files with that file extension to .gitignore
Add all files in the same folder as the selected file to
.gitignore
(If selecting a folder) add that folder to the .gitignore

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".

Improper project stucture when i am pulling from git repository

We have a project on a main branch in git repo.When i am pulling the project,the project structure is not coming properly.
And also is it necessary to store Eclipse-IDE specific file like .project in Git repo?
Any help would be appreciated.Thanks
You are completely free what files you store in your git repository.
Whatever you commit in whatever directory will be visible the same way in the same structure after a clone.
If there seem to be differences on the committing side and the cloned side, have a look at git status - maybe you did not commit all your files.
You have no need to store the .project file in your git repository as it is very specific to eclipse and store all the project related information for that particular workspace.
You can also add this file into the .gitignore file , that will tell git to ignore this file while doing a commit. In this way you can avoid checking in of file that you intentionally don't want to do.
You may have absolute paths to the source files. If the location of the files is not the absolute same as on the computer where you committed, the project won't be able to find the files.
Try right-click -> Properties on a file that cannot be found, and lookup the "Path" and "Location" properties. Location may be absolute, but Path should not.
I have figured out the problem that i was missing the .classpath file as we have not committed the .classpath file to git repository.So when i have taken the fresh clone of the repository that time i was missing my classpath file.So just added it and the problem solved.Another alternative is to go on to the Build path add the file to classpath.