43

I am using Ubuntu 11.10 (Oneiric Ocelot) and have just installed Git using

sudo apt-get install

The basic Git commands seem to work. (I have created a repository and added a directory structure to it.) But not Git GUI or gitk. This is what I get:

sudo git gui

Output:

git: 'gui' is not a git command. See 'git --help'.


Did you mean one of these?
grep
init
pull
push

For gitk:

sudo gitk

Output:

sudo: gitk: command not found

Do those commands run on Ubuntu and do I need to install them separately?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
OtagoHarbour
  • 3,969
  • 6
  • 43
  • 81
  • 2
    why sudo? gitk needs to be separately installed. Not sure what git-gui is? – Gaurav Agarwal Feb 03 '13 at 14:03
  • 4
    In Ubuntu (and Debian), Git has split gitk and git-gui out of the main `git` (previously `git-core`) package a while ago. They'll need to be installed additionally (or install `git-all` which will have them installed as well) – Nevik Rehnel Feb 03 '13 at 14:23
  • I use sudo because the directory is owned by www-data. – OtagoHarbour Feb 03 '13 at 18:55
  • I used git-all. Probably blew away a lot more disk space that I needed to solve this problem but will make sure I have all the tools for the future and I have over 400 GB. Thanks, Peter. – OtagoHarbour Feb 03 '13 at 18:57

6 Answers6

83
sudo apt-get install git-gui gitk
Fred Foo
  • 355,277
  • 75
  • 744
  • 836
  • Thanks. I used git-all which also worked but the way you mention is probably a lot more efficient in terms of disk space usage. Thanks, Peter. – OtagoHarbour Feb 03 '13 at 18:58
8
sudo apt-get install git-gui gitk

After installing it, it's very probable that no menu item appears in your desktop or .. To open them, open Terminal (usually, Ctrl + T) and type

git gui

or

gitk
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Bull
  • 748
  • 1
  • 11
  • 24
2

When you get an error during installing Git GUI as below,

sudo apt-get install git-gui 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package git-gui is not available, but is referred to by another package.

This may mean that the package is missing, has been obsoleted, or is only available from another source:

E: Package 'git-gui' has no installation candidate

Try this command as

  1. sudo apt-get install update
  2. sudo apt-get install git-gui

Then it worked.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Kavya
  • 29
  • 1
1

For a CentOS system you can use the following command:

sudo yum install git-gui gitk

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
jlmontes
  • 61
  • 1
  • 4
0

You can install all Git functions using this command:

sudo apt-get install git-core git-gui git-doc
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Milson
  • 1,525
  • 3
  • 15
  • 29
0

To install git-gui, type this command:

sudo apt-get install git-gui

Then to open git-gui, type:

git citool
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Prashant_M
  • 2,868
  • 1
  • 31
  • 24