How to Change the Default Directory Where GitBash Opens

Abstract: Set Git Bash default startup directory by editing the shortcut properties Start in field to streamline workflow.

Created: 2026-10-09 by
To change the default directory where Git Bash opens in Windows 10, you must modify the shortcut properties rather than relying on command-line arguments. This approach ensures that every time you launch the terminal from your desktop or taskbar, it automatically navigates to your preferred workspace folder. Git Bash is a powerful tool for developers who need a Unix-like environment on Windows, but its default behavior often starts in the user profile directory. Many users find this inconvenient when they primarily work within specific project folders. By adjusting the shortcut configuration, you can streamline your workflow and reduce the number of manual commands required to reach your working directory. This method is reliable across different versions of Git for Windows and does not require complex scripting or registry edits.

Understanding the Shortcut Properties

The most effective way to set a custom starting directory is through the Windows shortcut system. When you install Git for Windows, it creates shortcuts on your desktop and potentially pins them to your taskbar. These shortcuts are essentially executable links that point to the git-bash.exe file. The target path includes several parameters that control how the application behaves upon launch. You do not need to use flags like --cd=, which are not standard for this purpose. Instead, you will edit the "Start in" field within the shortcut's properties. This field explicitly tells Windows which directory to set as the current working directory before executing the shell script. It is a native Windows feature, ensuring compatibility and stability regardless of the Git version you are using.

Modifying the Desktop Shortcut

If you typically launch Git Bash from your desktop, follow these steps to update the starting location:
  1. Locate the Shortcut: Find the Git Bash icon on your desktop. If it is not there, open the Start menu, search for "Git Bash", right-click the result, and select "More" then "Open file location". This will take you to the shortcut file.
  2. Access Properties: Right-click the Git Bash shortcut and select "Properties" from the context menu. Alternatively, you can click on the shortcut once to highlight it and press Alt+Enter.
  3. Edit the Target Field: In the Properties window, ensure you are on the "Shortcut" tab. Look for the "Target" box. This contains the path to git-bash.exe. You generally do not need to change this unless you are moving the installation.
  4. Set the Start-in Folder: Locate the "Start in:" box just below the Target field. Clear any existing content and paste or type the full path to your desired directory (e.g., C:\Users\YourName\Projects). Ensure you use forward slashes if needed, though backslashes usually work fine here.
  5. Apply Changes: Click "Apply" and then "OK" to save the changes. Double-click the shortcut to verify that Git Bash now opens directly in the specified folder.
This process is straightforward and immediate. Any subsequent launches via this specific shortcut will respect the new setting. If you have multiple projects, you might consider creating separate shortcuts with different "Start in" paths for each major workspace.

Updating Taskbar Pinned Shortcuts

Many users prefer to keep Git Bash pinned to their taskbar for quick access. However, pinning a shortcut creates a copy of the link, meaning changes made to the original desktop shortcut may not reflect on the taskbar version. To fix this, you must update the pinned item directly. Right-click the Git Bash icon on your taskbar. If you see "Pin to taskbar" grayed out, it means it is already pinned. Instead, look for an option to manage the shortcut or simply right-click the name that appears in the jump list. A more reliable method is to unpin the current icon, apply the changes to the original shortcut file as described above, and then re-pin the updated version. When you drag the newly configured shortcut onto the taskbar, Windows will recognize it as the same application and replace the old entry. Verify the new start-up directory by launching it from the taskbar. This ensures consistency between your desktop and taskbar experiences.

Alternative Methods and Considerations

While modifying shortcuts is the most common solution, some users might explore other options. You can configure Git Bash to remember the last used directory by adding settings to your .bashrc file, but this requires additional scripting and may not persist correctly if the session crashes. Another approach involves using environment variables, but this affects all applications, not just Git Bash. For those who frequently switch between many directories, keeping multiple shortcuts with different "Start in" paths is often more efficient than trying to force a single global default. This allows you to tailor each launch to the specific project context. If you encounter issues where the directory resets unexpectedly, check if any group policy scripts or third-party software are overriding the shortcut properties. Additionally, ensure that the path you entered exists and that your user account has read/write permissions for that folder. For related troubleshooting on Windows systems, you might find our guide on How to Fix Hard Drive Issues on Windows 7 and Windows 10 helpful if you suspect file system errors are affecting your shortcuts.

Frequently Asked Questions

Does changing the shortcut affect the actual installation path?

No, modifying the "Start in" field only changes the initial working directory for the session. It does not move or alter the location of the git-bash.exe binary itself. Your Git installation remains intact in its original folder.

Can I use relative paths in the Start-in field?

It is highly recommended to use absolute paths. Relative paths can be ambiguous depending on where Windows resolves the execution context, leading to unpredictable results or errors when the shortcut is launched from different locations.

Why does Git Bash still open in my home directory after I changed the shortcut?

This usually happens if you edited the wrong shortcut or if the taskbar icon is a separate instance. Always verify that you are editing the exact shortcut file you intend to use. Unpinning and repinning the taskbar icon often resolves this discrepancy.

Is there a way to make this change permanent for all users?

You would need to modify the shortcut files located in the public user profiles or use Group Policy Preferences to deploy the shortcut with the correct "Start in" setting to all machines in a domain environment.

What happens if the specified directory is deleted?

Git Bash will likely fail to launch or will open in a fallback directory such as the user's home folder. It is good practice to ensure that the directory specified in the "Start in" field always exists and is accessible.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More