tags:

views:

54

answers:

2

I put my home directory under version control and if I start git-gui now from my Gnome panel I can only work on this repository. There is no longer this dialog that lets me browse for or enter a repository location or pick one that I used before.

I could not find an according commandline or .gitconfig switch.

How can I force git-gui to display the dialog?

A: 

I'm not sure how to get the chooser dialog, but you can open a shell, navigate to the other dir you want, and type git gui there. Then it should pop up git gui for that repository instead of the one at your home dir.

Jani Hartikainen
That works, but not if I start git-gui from the panel. There, it always picks my home directory repo.
fmarc
+3  A: 

Create a file with the following contents and mark it executable:

#!/bin/sh
cd /
git gui

Save that file somewhere in your PATH (e.g. /usr/bin/my-git-gui). Then change your gnome-panel launcher to point to that file instead of git gui.

(git gui issues the prompt you want only if the working directory is not in a git repo. gnome-panel launchers set the working directory to ~, which in your case is a git repo; the script above is just a wrapper that sets the working directory to something that's hopefully not a git repo.)

Phil
That definitely works, thanks!
fmarc