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

  • Home
  • SEARCH
  • 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 6983687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:27:05+00:00 2026-05-27T18:27:05+00:00

If i run Git bash from Git Extention ( CTRL + G ), my

  • 0

If i run Git bash from Git Extention (CTRL+G), my home directory is %USERPROFILE%, which is ok.

If I run Git bash from the context menu of a git repo folder, or if I run Git bash from the start menu, my home directory is %HOME%, which is different.

How can I set up git bash to always use %USERPROFILE% as home directory (I have the .ssh folder within) ?

If it can help, on git bash run from Git Ext, I have :

$ echo $HOME
/c/Users/mylogin

Same command on git bash run directly :

$ echo $HOME
/h

h: is my corporate home directory

What can I do ?

  • 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-27T18:27:06+00:00Added an answer on May 27, 2026 at 6:27 pm

    The git bash provided with msysgit in its repo is a script you can edit, in order to set HOME to %USERPROFILE%.
    It is basically what it does by default, except if HOME is already defined, the git bash script won’t modify that value (but you can, if you edit said script).

    I suspect that, in your corporate environment, HOME is defined to a network drive, in order for various configuration files (maven, ssh, …) to be stored on a remote, secure and backed-up drive.
    That would explain why HOME is not changed by the Git bash script.
    The Git Extension obviously isn’t as careful as the first script, and will change/define whatever value it needs.


    As the OP Steve B comments:

    The HOME is set, for the Git bash, in etc/profile:

    # Set up USER's home directory
    if [ -z "$HOME" -o ! -d "$HOME" ]; then
      HOME="$HOMEDRIVE$HOMEPATH"
      if [ -z "$HOME" -o ! -d "$HOME" ]; then
        HOME="$USERPROFILE"
      fi
    fi
    

    I removed the first candidate home location, and it works.

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

Sidebar

Related Questions

I am trying to run git from a different directory than I am in.
I'm seeing this error when I run: rake/gem from my Git Bash. Anyone know
So I've installed msysgit, and run git successfuly from the bash shell. From within
I want to remove all files from Git at ~/bin/. I run git rm
Do all git commands have a --dry-run option, or one which would indicate what
I have msysgit installed with OpenSSH option. In Git bash, I can run ssh-agent,
I am using windows git bash, when i run the command git push beanstalk
I'm having an issue executing jruby from the mingw git bash shell in windows.
Folks, I'm using git tools such as git bisect run which need to call
Here is the script that I want to run using git filter-branch : #!/bin/bash

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.