- This topic has 14 replies, 2 voices, and was last updated 5 years, 10 months ago by Mork.
-
AuthorPosts
-
MorkParticipantI am trying to keep Myeclipse from adding all the .class and many other file types to Git each time they get compiled. I created a .gitignore file and put it in the project root and checked it in. Yet, the .class and other files continue to get staged.
If I need to put that .gitignore in a particular location, please advise.
—
But my first item is how to even “see” the .gitignore file as it doesn’t show up in any view that I’ve tried. I’ve searched online, but the examples for Eclipse don’t seem to apply to MyEclipse.
Thanks in advance,
- This topic was modified 5 years, 10 months ago by Mork.
Aaron LaraMemberHi Mork!
You can see hidden*.filename
files by going toFilters
in the Package Explorer view and then checking the*.resources
item. See Screenshots.For the right location of the
.gitignore
file you can use theGit Stagging
view, then right click on a.class
element (or any kind of file you want to hide) and then selectignore
. It will automatically create a.gitignore
file for you.Cheers!
Aaron- This reply was modified 5 years, 10 months ago by Aaron Lara.
Attachments:
You must be logged in to view attached files.
MorkParticipantThanks Aaron. Your suggestion fixed the invisible file problem I was having. Difficult to realize it’s that tiny “v” to click.
—–
On my other issue, I don’t see an “ignore” option for the staging view. I had already tried that. See my attached screenshot below.
Thanks in advance for your next reply. 🙂
- This reply was modified 5 years, 10 months ago by Mork.
Attachments:
You must be logged in to view attached files.
Aaron LaraMemberCan you try moving back the file to
Unstaged Changes
and then see if theignore
option appears?
MorkParticipantI had tried that as well but no ignore option. And I tried both of these before creating a gitignore file.
See screenshot for that case.
Can you test and figure out what’s going on?
Thanks very much
Attachments:
You must be logged in to view attached files.
Aaron LaraMemberThe option is correctly displayed at my end in MyEclipse CI 2018.12.0 (screenshot attached). Can you let me know what version of MyEclipse are you running? I’m checking up with my Team what can be causing this issue at your end.
Cheers!
Attachments:
You must be logged in to view attached files.
MorkParticipantThat is so strange.
I’m using this version:
MyEclipse Enterprise Workbench
Version: CI 2018.12.0
Build id: 16.0.0-20181217Thanks
Aaron LaraMemberCan you try clicking
untrack
first and then see ifignore
option is enabled after that?
MorkParticipantYes, that seems to work, but it’s not creating a .gitignore file that I see and I then still have to untrack and ignore every .class or other file.
—-
I have a .gitignore file in the root of my project, but it’s not been respected. I just copied this one from an online posting, but it seems to have the relevant items I want to block.
I’ll post this question on a Git forum since I’m obviously missing something still.
Thanks for the great support! 🙂
Attachments:
You must be logged in to view attached files.
Aaron LaraMemberMaybe if you share the content of the
.gitignore
we can give pointers. You might have already seen this but it’s worth reading: https://git-scm.com/docs/gitignore
MorkParticipantHere’s the .gitignore as shown in the project structure above. I found this example online and it seems to have some good entries,
It seems based on what I’ve read, it should be blocking these files, but nope. They’re still getting staged.
—
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so# Packages #
############
# it’s better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip# Logs and databases #
######################
*.log# OS generated files #
######################
.DS_Store*
ehthumbs.db
Icon?
Thumbs.db# Editor Files #
################
*~
*.swp# Gradle Files #
################
.gradle
.m2# Build output directories #
##########################
/target
*/target
/build
*/build# IntelliJ specific files/directories #
#######################################
out
.idea
*.ipr
*.iws
*.iml
atlassian-ide-plugin.xml# Eclipse specific files/directories #
######################################
.classpath
.project
.settings
.metadata# NetBeans specific files/directories #
#######################################
.nbattrs
Aaron LaraMemberMork, I cannot see anything wrong with your
.gitignore
file. But look at this StackOverflow thread. It looks like you need to stop tracking all of those files first.Just a warning that if you do what the answer say (
git rm -r --cached bin gen
), it will remove the bin and gen dirs … Not sure if you want to do that.- This reply was modified 5 years, 10 months ago by Aaron Lara.
MorkParticipantSince there’s really nothing in git that’s important yet for this project, how about I
(1) TEAM-un-share it,
(2) Then, delete the repository and just start over adding the files back into a new repo (where hopefully the .gitignore will be respected)?
I’m cool with that approach.
What do you think?
Thanks,
- This reply was modified 5 years, 10 months ago by Mork.
Aaron LaraMemberI think that will work too.
Good Luck!
MorkParticipantThe Team-disconnect seemed to work well, but I guess I clicked too many options when I removed the repository as that deleted the project from MyE (non-recoverable) as well. This project setup was all just for testing so I’ll be more careful in the future.
Thanks again for all the great and helpful replies! 🙂
-
AuthorPosts