Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6682021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:39:27+00:00 2026-05-26T04:39:27+00:00

I have an android project that has a test module that will remove and

  • 0

I have an android project that has a test module that will remove and recreate .apk files in a subdirectory in the git directory.

I have added these to .gitignore (the directory, the files explicitly, and *.apk ) and then I have done

git rm -r --cached src/main/Tests/bin

and git tells me:

rm 'src/main/Tests/bin/Tests-debug-unaligned.apk'
rm 'src/main/Tests/bin/Tests-debug.apk'
rm 'src/main/Tests/bin/Tests.ap_'
rm 'src/main/Tests/bin/classes.dex'

i then

git commit . -m "removed apk files"

I run the tests again which delete the files and the recreate them. I run git status and they show up as modified. It seems .gitignore is not working. Here is my .gitignore file

*ipr
*iml
*iws
.gitignore
out/
*apk
src/main/Tests/bin
src/main/Tests/bin/*
src/main/Tests/bin/Tests-debug-unaligned.apk
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:39:28+00:00Added an answer on May 26, 2026 at 4:39 am

    I just tried your recipe and it worked for me.

    ~ % mkdir deleteme
    ~ % cd deleteme
    ~/deleteme % mkdir src src/main src/main/Tests src/main/Tests/bin
    ~/deleteme % touch src/main/Tests/bin/blah.apk                   
    ~/deleteme % git init
    Initialized empty Git repository in /Users/sri/deleteme/.git/
    ~/deleteme (master*) % touch src/main/hello.txt
    ~/deleteme (master*) % git add .
    ~/deleteme (master*) % git commit -m "init"
    [master (root-commit) 0ef5764] init
     0 files changed, 0 insertions(+), 0 deletions(-)
     create mode 100644 src/main/Tests/bin/blah.apk
     create mode 100644 src/main/hello.txt
    ~/deleteme (master) % vi .gitignore
    ~/deleteme (master) % git rm -r --cached src/main/Tests/bin
    rm 'src/main/Tests/bin/blah.apk'
    ~/deleteme (master*) % git commit -m "removed"
    [master 5ca6456] removed
     0 files changed, 0 insertions(+), 0 deletions(-)
     delete mode 100644 src/main/Tests/bin/blah.apk
    ~/deleteme (master) % touch src/main/Tests/bin/blah.apk    
    ~/deleteme (master) % git status
    # On branch master
    nothing to commit (working directory clean)
    ~/deleteme (master) %  
    

    Perhaps the gitconfig in some other directory (or a global directive) that’s overriding what you have in the gitconfig you have stated. You did not mention where this gitconfig is located. See the man page for gitignore or the online help docs for the precedence of the various locations where you can specify ignore rules. The man pages say…

    …the following order of
    precedence, from highest to lowest (within one level of precedence, the last matching
    pattern decides the outcome):
    Patterns read from the command line for those commands that support
    them.

       o   Patterns read from a .gitignore file in the same directory as the path, or in any
           parent directory, with patterns in the higher level files (up to the toplevel of the
           work tree) being overridden by those in lower level files down to the directory
           containing the file. These patterns match relative to the location of the .gitignore
           file. A project normally includes such .gitignore files in its repository, containing
           patterns for files generated as part of the project build.
    
       o   Patterns read from $GIT_DIR/info/exclude.
    
       o   Patterns read from the file specified by the configuration variable core.excludesfile
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Android library project that has been working for me pretty well,
Background I have an Android project that has a database with two tables: tbl_question
I have an Android project that branched into three different applications, app-1 , app-2
I have an Android project and Eclipse is telling me my project has an
n00b here (first Android project). I have been given a custom video codec that
I have a project that uses 3 other projects as libraries and has quite
I'm considering the use of JiBX for a project that will have to run
I have a simple android project that I am trying to debug inside of
I have created one Android Project with Ant build. And also created Test Project
I have an Android Eclipse project that I'd like to divide into two sub-projects.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.