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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:48:10+00:00 2026-05-15T15:48:10+00:00

I have installed the portable git version on my flash drive, but I don’t

  • 0

I have installed the portable git version on my flash drive, but I don’t want my repository to be in the same directory as the program. I can get to the directory using:

$ git -- git-dir=../Gits --work-tree=..Gits

But I don’t want to enter that every time. So I found in this article on the gitconfig file. But it only shows how to set the core.worktree

core.worktree

Set the path to the root of the work tree. This can be overridden by
the GIT_WORK_TREE environment variable
and the –work-tree command line
option. It can be an absolute path or
a relative path to the .git directory,
either specified by –git-dir or
GIT_DIR, or automatically discovered.
If –git-dir or GIT_DIR are specified
but none of –work-tree, GIT_WORK_TREE
and core.worktree is specified, the
current working directory is regarded
as the root of the work tree.

Note that this variable is honored even when set in a configuration file
in a “.git” subdirectory of a
directory, and its value differs from
the latter directory (e.g.
“/path/to/.git/config” has
core.worktree set to
“/different/path”), which is most
likely a misconfiguration. Running git
commands in “/path/to” directory will
still use “/different/path” as the
root of the work tree and can cause
great confusion to the users.

I have tried these settings to no avail.

[core]
  worktree = ../Gits
  gitdir = ../Gits

Does anyone know a way to set the git-dir and work-tree directories for PortableGit-1.7.0.2-preview20100309.7z for Windows so I don’t have to type that in all the time?

Also is there a way to add the passphrase so I don’t have to type that in either? I saw these instructions, but the portable version apparently doesn’t have a ~/.profile or ~/.bashrc file.

  • 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-15T15:48:10+00:00Added an answer on May 15, 2026 at 3:48 pm

    Why would any git repo in the same directory than your portable installation?

    As long as your %PATH% reference your portable Git/cmd directory, you can just type ‘git whatever‘ in your Git repo anywhere, and the working directory and git directory will be at their default places.

    And any Git version has access to ~/.profile or ~/.bashrc: open a Git bashrc, and type cd, then pwd: the path displayed is your ‘~‘.
    Then, if you have no .profile or .bashrc yet, create one, put it it a simple echo (echo .profile in the .profile file, ‘echo .bashrc‘ in the .bashrc), open another Git bashrc and check if your .profile/.bashrc are activated.

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

Sidebar

Related Questions

I have installed some MSI with GUID (0733556C-37E8-4123-A801-D3E6C5151617). The program registered in the registry:
I have installed RubyMine on Mac but my development environment for Ruby and Rails
I have installed WAMP and enable some extension. After that i have installed eclipse
I have installed Visual Studio 2010 and Silverlight 4 tools. Still, i am getting
I have trouble getting started with rails 3.0.0, because it just doesn't load the
We're presenting a site that we've done for a client and put this all
I am upsizing the back end of a client's Access app tomorrow and need
Im starting to develop for android and i would like to test my aplication
My current role requires me to setup environment which mimics the customer's and perform
I'm very confused about how to get TTS working in VB 2010 Express. I

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.