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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:21:51+00:00 2026-05-20T00:21:51+00:00

Is there any way to ignore a directory when you push remotely? The catch

  • 0

Is there any way to ignore a directory when you push remotely? The catch is I don’t want to ignore it. I still want to track the directory, and have local commits and branches for it. Say, I’m working on a project that relies on a database. This project does not have transitional schema or anything. It is populated with data for testing. I have a symbolic link for MySQL’s folder/files (MyISAM MYD/MYI) to my local repository. I want the database and the commits in sync, but cannot push the database (or assets, etc). I tried a submodule, with no avail – the parent repo ignores the child submodule changes. How would I go about this? Example structure:

/repo/my-project <– git repo
/repo/my-project/src <– push commits related to this section to a remote repo that uses this as the root directory

/repo/my-project/mysql <– track these but don’t push them
/repo/my-project/mysql/db_1/table_1.frm
/repo/my-project/mysql/db_1/table_1.MYD
/repo/my-project/mysql/db_1/table_1.MYI

Thanks!

  • 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-20T00:21:52+00:00Added an answer on May 20, 2026 at 12:21 am

    When you push a given branch, you push the commits on that branch. If those commits include the contents of a given directory, you will be pushing that content.

    Your two options are:

    • Keep that directory on a branch (or branches) which are never merged into the branches you push. You can still merge other changes into that branch freely, of course.

    • Keep that directory in a separate repository. The easiest approach would then be to symlink that directory to the real location of the repository, and ignore the path. (You can ignore it in .git/info/excludes to avoid even publishing that gitignore entry.) More detailed instructions:

      cd path/to/project
      
      # move the directory outside your project
      mv database-dir ..
      
      # add an ignored symlink to it
      echo "database-dir" >> .git/info/excludes
      ln -s ../database-dir database-dir
      
      # create a new repo in the directory to track it
      cd ../database-dir
      git init; git add .; git commit
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to get just a part from MySql cell and ignore
Is there any easy way to tell perl now ignore everything that is printed?
Is there a way to do a git pull that ignores any local file
Is there any way in Notepad++ (or even with another tool) to change the
Is there any way I can set a formatter on models that will convert
Is there any way to use Google's API to retrieve a user's current zipcode
Is there any way to overload the > (greater than) operator, to be able
Is there any way we can fetch X509 Public Cetrificates using c# from AD
Is there any way to stop animation in iOS 3 ? I know about:
Is there any way to update nested documents by id or some other field?

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.