git的安装方法有两种:一种是直接通过ubuntu的apt安装,这种方法最简单,缺点是版本可能不是最新的。所以还有另一种方法是下载源码进行安装,这种能安装到最新的版本。
apt安装
sudo apt-get update
sudo apt-get install git
然后配置自己的git 账号信息,这样才能进行相关的操作:
git config --global user.name "Your Name"
git config --global user.email "youremail@domain.com"
可以通过下面的命令查看git 的配置信息:
git config --list