0

Is it safe to add xmlparser/ to .gitignore when developing android project in EclipseADT?

Right now I am using recommended:

*.pydevproject
.metadata
.gradle
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# PDT-specific
.buildpath

# sbteclipse plugin
.target

# TeXlipse plugin
.texlipse

I am asking because files marked as "deleted" are in red in git bash:

Nenad@I3770K ~/eclipseADT/AA4AB_V3 (master)
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        deleted:    xmlparser/.classpath
        deleted:    xmlparser/.project
        deleted:    xmlparser/AndroidManifest.xml
        deleted:    xmlparser/gen/android/support/v7/appcompat/R.java
        deleted:    xmlparser/gen/com/example/xmlparser/BuildConfig.java
        deleted:    xmlparser/gen/com/example/xmlparser/R.java
        deleted:    xmlparser/ic_launcher-web.png
        deleted:    xmlparser/libs/android-support-v4.jar
        deleted:    xmlparser/proguard-project.txt
        deleted:    xmlparser/project.properties
        deleted:    xmlparser/res/drawable-hdpi/ic_launcher.png
        deleted:    xmlparser/res/drawable-mdpi/ic_launcher.png
        deleted:    xmlparser/res/drawable-xhdpi/ic_launcher.png
        deleted:    xmlparser/res/drawable-xxhdpi/ic_launcher.png
        deleted:    xmlparser/res/layout/activity_main.xml
        deleted:    xmlparser/res/menu/main.xml
        deleted:    xmlparser/res/values-v11/styles.xml
        deleted:    xmlparser/res/values-v14/styles.xml
        deleted:    xmlparser/res/values-w820dp/dimens.xml
        deleted:    xmlparser/res/values/dimens.xml
        deleted:    xmlparser/res/values/string.xml
        deleted:    xmlparser/res/values/strings.xml
        deleted:    xmlparser/res/values/styles.xml
        deleted:    xmlparser/src/com/example/xmlparser/HandleXML.java
        deleted:    xmlparser/src/com/example/xmlparser/MainActivity.java

no changes added to commit (use "git add" and/or "git commit -a")

UPDATE: To be more precise, I can't find those folders at all. Workspace is AA4AB_V3, and there are several projects within it. But whatever I do (run projects, clean and rebuild) I can't make them come to existence. They do not exist at all. I don't know where Git found them, but in order shown in that log those folders don't exist. Projects are working fine, and I don't recall that such folders ever existed in first place during creation of android projects.

As pointed out by user VonC Some time ago I ran through this xmlparser tutorial. When I think of it now, yes I named it xmlparser and then renamed it WeatherApp, and later closed project. What I don't know is why is Git keeping info about "deleted" folders, and how should I clean this if it is in some sort of cache?

Nenad Bulatović
  • 7,238
  • 14
  • 83
  • 113
  • Is the xmlparser folder content a generated content? If it can be generated at any time, it cn be added to the .gitignore. – VonC Nov 30 '14 at 17:02
  • @VonC I am not sure about it, that's why I am asking. – Nenad Bulatović Nov 30 '14 at 17:18
  • @VonC To be more precise, I can't find those folders at all. Workspace is AA4AB_V3, and there are several projects within it. But whatever I do (run projects, clean and rebuild) I can't make them come to existence. They do not exist at all. I don't know where Git found them, but in order shown in that log those folders don't exist. Projects are working fine, and I don't recall that such folders ever existed in first place during creation of android projects. – Nenad Bulatović Dec 01 '14 at 06:56
  • 1
    Maybe a tutorial like http://www.tutorialspoint.com/android/android_xml_parsers.htm could help illustrating where/if those folders are used or generated. – VonC Dec 01 '14 at 06:59
  • For the person who downvoted this: why don't you share your eternal wisdom with me, instead of downvoting this. Less than week ago I read book "Git- Version Control for Everyone" and there wasn't even mention of such problem, and Git .ignore file that I am using is standard recommended .ignore for Eclipse Android projects. – Nenad Bulatović Dec 01 '14 at 06:59
  • @VonC Thank you for that link - I know that tutorial, some time ago I ran through that tutorial. When I think of it now, yes I named it xmlparser and then renamed it WeatherApp. What I don't know is why is Git keeping info about "deleted" folders, and how should I clean this if it is in some sort of cache? – Nenad Bulatović Dec 01 '14 at 07:05

1 Answers1

1

@VonC and this post helped me to figure out what happened and what should I do. Project was renamed and master branch got out of sync or whatever.

What I did to fix it was to issue command:

git rm --cached xmlparser/*

which resulted in this:

Nenad@I3770K ~/eclipseADT/AA4AB_V3 (master)
$ git rm --cached xmlparser/*
rm 'xmlparser/.project'
rm 'xmlparser/AndroidManifest.xml'
rm 'xmlparser/gen/android/support/v7/appcompat/R.java'
rm 'xmlparser/gen/com/example/xmlparser/BuildConfig.java'
rm 'xmlparser/gen/com/example/xmlparser/R.java'
rm 'xmlparser/ic_launcher-web.png'
rm 'xmlparser/libs/android-support-v4.jar'
rm 'xmlparser/proguard-project.txt'
rm 'xmlparser/project.properties'
rm 'xmlparser/res/drawable-hdpi/ic_launcher.png'
rm 'xmlparser/res/drawable-mdpi/ic_launcher.png'
rm 'xmlparser/res/drawable-xhdpi/ic_launcher.png'
rm 'xmlparser/res/drawable-xxhdpi/ic_launcher.png'
rm 'xmlparser/res/layout/activity_main.xml'
rm 'xmlparser/res/menu/main.xml'
rm 'xmlparser/res/values-v11/styles.xml'
rm 'xmlparser/res/values-v14/styles.xml'
rm 'xmlparser/res/values-w820dp/dimens.xml'
rm 'xmlparser/res/values/dimens.xml'
rm 'xmlparser/res/values/string.xml'
rm 'xmlparser/res/values/strings.xml'
rm 'xmlparser/res/values/styles.xml'
rm 'xmlparser/src/com/example/xmlparser/HandleXML.java'
rm 'xmlparser/src/com/example/xmlparser/MainActivity.java'

Then I issued one commit

git commit -m "026: reset cached files"

and on check everything went in order:

Nenad@I3770K ~/eclipseADT/AA4AB_V3 (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working directory clean

Thank you VonC for pointing me in right direction!

Community
  • 1
  • 1
Nenad Bulatović
  • 7,238
  • 14
  • 83
  • 113