ubuntu下git的安装与使用

1、更新软件源
sudo apt update

sudo apt upgrade


2、在线安装git 
sudo apt install git  

ubuntu下git的安装与使用
3、查看当前的git版本
git --version           

                  ubuntu下git的安装与使用                 
4、第一次使用前的配置
git config --global user.name '007skyfall'        #设置用户名
config命令的--global参数,用了这个参数,表示你这台机器上所有的Git仓库都会使用这个配置,当然也可以对某个仓库指定不同的用户名和Email地址。
git config --global user.email '[email protected]'       //设置电子邮箱
git config --list       

ubuntu下git的安装与使用

5、初始化仓库

git init 

ubuntu下git的安装与使用 

6、向仓库添加文件

ubuntu下git的安装与使用 

 

7、将文件放置暂存区

git add .

git status

ubuntu下git的安装与使用 

 

8、将文件放置仓库中

git commit -m "20190201_c++_testc_ode" 

git status

ubuntu下git的安装与使用