For some reason, gitk always starts under all other apps.

How to make it start on top of all other apps, like a normal program?

Start it from the terminal with the gitk command, which lives in /usr/bin. There is no icon to click on...maybe need to create one?

Or is there a way to tell the OS to start it on top of all others? Perhaps with applescript?

Lion 10.7.5


You will need to edit the gitk file.

To find the location of your gitk file type the following

which gitk

Open the gitk file in a text editor, near the top you should see a line like the following

exec wish "$0" -- "$@"

Edit the line so that it looks like this

exec wish "$0" -- "$@" & exec osascript -e "tell application \"Wish\" to activate"

The next time you invoke gitk from the terminal it will come to the foreground

Your question is similar to a question on stackoverflow, if you don't want to edit the gitk file you can find other ways to achieve it there https://stackoverflow.com/q/11248284/1873471

  • Awesome. It worked. Thank you. Didn't think to look on StackOverflow. Live n' learn. – B Seven Dec 15 '12 at 1:22
  • This works, but sometimes throws an error 27:35: execution error: An error of type -10827 has occurred. (-10827) – B Seven Dec 21 '12 at 22:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .