[root@hadoop0 ~]# git
-bash: git: command not found
[root@hadoop0 ~]# yum install git
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.sina.cn
* extras: mirrors.sina.cn
* updates: mirror.bit.edu.cn
base | 3.7 kB 00:00
extras | 3.3 kB 00:00
updates | 3.4 kB 00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package git.i686 0:1.7.1-4.el6_7.1 will be installed
--> Processing Dependency: perl-Git = 1.7.1-4.el6_7.1 for package: git-1.7.1-4.el6_7.1.i686
--> Processing Dependency: perl(Git) for package: git-1.7.1-4.el6_7.1.i686
--> Processing Dependency: perl(Error) for package: git-1.7.1-4.el6_7.1.i686
--> Running transaction check
---> Package perl-Error.noarch 1:0.17015-4.el6 will be installed
---> Package perl-Git.noarch 0:1.7.1-4.el6_7.1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===========================================================
Package Arch Version Repository Size
====================================================
Installing:
git i686 1.7.1-4.el6_7.1 base 4.5 M
Installing for dependencies:
perl-Error noarch 1:0.17015-4.el6 base 29 k
perl-Git noarch 1.7.1-4.el6_7.1 base 28 k
Transaction Summary
=================================================================
Install 3 Package(s)
Total download size: 4.6 M
Installed size: 15 M
Is this ok [y/N]: y
Downloading Packages:
http://mirrors.sina.cn/centos/6.8/os/i386/Packages/git-1.7.1-4.el6_7.1.i686.rpm: [Errno 12]
Timeout on http://mirrors.sina.cn/centos/6.8/os/i386/Packages/git-1.7.1-4.el6_7.1.i686.rpm: (28,
'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds')
Trying other mirror.
(1/3): git-1.7.1-4.el6_7.1.i686.rpm | 4.5 MB 01:27
(2/3): perl-Error-0.17015-4.el6.noarch.rpm | 29 kB 00:00
(3/3): perl-Git-1.7.1-4.el6_7.1.noarch.rpm | 28 kB 00:01
------------------------------------------------------------------------------
Total 28 kB/s | 4.6 MB 02:49
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : 1:perl-Error-0.17015-4.el6.noarch 1/3
Installing : git-1.7.1-4.el6_7.1.i686 2/3
Installing : perl-Git-1.7.1-4.el6_7.1.noarch 3/3
Verifying : perl-Git-1.7.1-4.el6_7.1.noarch 1/3
Verifying : 1:perl-Error-0.17015-4.el6.noarch 2/3
Verifying : git-1.7.1-4.el6_7.1.i686 3/3
Installed:
git.i686 0:1.7.1-4.el6_7.1
Dependency Installed:
perl-Error.noarch 1:0.17015-4.el6 perl-Git.noarch 0:1.7.1-4.el6_7.1
Complete!
[root@hadoop0 ~]# git
usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path]
[-p|--paginate|--no-pager] [--no-replace-objects]
[--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE]
[--help] COMMAND [ARGS]
The most commonly used git commands are:
add Add file contents to the index
bisect Find by binary search the change that introduced a bug
branch List, create, or delete branches
checkout Checkout a branch or paths to the working tree
clone Clone a repository into a new directory
commit Record changes to the repository
diff Show changes between commits, commit and working tree, etc
fetch Download objects and refs from another repository
grep Print lines matching a pattern
init Create an empty git repository or reinitialize an existing one
log Show commit logs
merge Join two or more development histories together
mv Move or rename a file, a directory, or a symlink
pull Fetch from and merge with another repository or a local branch
push Update remote refs along with associated objects
rebase Forward-port local commits to the updated upstream head
reset Reset current HEAD to the specified state
rm Remove files from the working tree and from the index
show Show various types of objects
status Show the working tree status
tag Create, list, delete or verify a tag object signed with GPG
See 'git help COMMAND' for more information on a specific command.
[root@hadoop0 ~]#