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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:11:38+00:00 2026-05-31T09:11:38+00:00

Possible Duplicate: Is it possible to include a file in your .gitconfig With bash

  • 0

Possible Duplicate:
Is it possible to include a file in your .gitconfig

With bash and zsh I can source subfiles in order to better organize my config.

Can I do something similar with .gitconfig?

  • 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-31T09:11:39+00:00Added an answer on May 31, 2026 at 9:11 am

    (March 2012) It looks like this is finally going to be possible soon — git 1.7.10 is going to support this syntax in .gitconfig:

    [include]
        path = /path/to/file
    

    See here for a detailed description of the git change and its edge cases.

    By the way, a couple of subtleties worth pointing out:

    1. Path expansion, e.g. ~ or $HOME, does not appear to be supported.

    2. If a relative path is specified, then it is relative to the .gitconfig file that has the [include] statement. This works correctly even across chained includes — e.g. ~/.gitconfig can have:

      [include]
          path = subdir/gitconfig
      

      and subdir/gitconfig can have:

      [include]
          path = nested_subdir/gitconfig
      

      … which will cause subdir/nested_subdir/gitconfig to be loaded.

    3. If git can’t find the target file, it silently ignores the error. This appears to be by design.

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

Sidebar

Related Questions

Possible Duplicate: C/C++, can you #include a file into a string literal? I have
Possible Duplicate: Why can templates only be implemented in the header file? When I
Possible Duplicate: include file from different directory I have a site laid out as
Possible Duplicate: Can you use $_GET variables when including a file in PHP? Is
Possible Duplicate: How come some site urls do not include a file extension? Hi
Possible Duplicate: Why can templates only be implemented in the header file? Why should
Possible Duplicate: Why can templates only be implemented in the header file? Undefined reference
Possible Duplicate: What's the difference between a header file and a library? Can anyone
Possible Duplicate: Displaying the #include hierarchy for a C++ file in Visual Studio I
Possible Duplicate: Do you know tool building tree of include files in project\file? Currently

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.