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 8823769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:26:28+00:00 2026-06-14T06:26:28+00:00

I am using git in a project where Ant is the build system. Since

  • 0

I am using git in a project where Ant is the build system.
Since I do not wish to add “build” directories to git but need to add build.xml files I have resorted to the following two lines in my .gitignore files:

build/
!build.xml

Is there a better / more concise way ?

UPDATE:
turns out build.xml was ignored due to a .gitignore in a directory higher up the path. Once that was removed, build/ correctly ignores only the build folder, not the build.xml file beside it.

  • 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-06-14T06:26:29+00:00Added an answer on June 14, 2026 at 6:26 am

    No, there is no better way, that’s pretty much the way to do it. To be precise,

    build/*
    !build/build.xml
    

    As you want to have the folder and ignore all other files in it except build.xml.

    Note though that common directory layout for Ant is that build.xml is in the app root folder, whereas build folder only contains files created during build. See further rationale in, for example, here.


    Edit. if you actually have build.xml in the app root, just

    build
    

    in .gitignore should be enough. However, it should be noted it only applies to detecting new entries, if you’ve already committed something to git, you’ll have to remove that yourself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have forked an SVN project using Git because I needed to add features
I'm using git for a while. In most project, I'm the only developer but
I am using git on a project, that generates lots of data-files (simulation-results). I
I have a private .NET (C#) project using Git Repository in Unfuddle.com. I wish
I'm using git in a project with multiple branches used concurrently, that is: A
Possible Duplicate: Using Git with an existing Xcode project Setting up a git repository
I'm using git to manage a tiny project. I've been performing all of my
I have a project that's using git. When I received the repo, it had
I'm using the excellent Sprint.ly to manage my project. I'm using git for source
we have just started using a git account of our Django website project so

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.