最近在做自己的个人博客项目,部署在阿里云主机上,系统为ubuntu 16.04.4。项目开发在自己的Windows电脑上,每次项目进行改动后都需要手动上传文件到服务器上,感觉很是麻烦。所以准备在服务器上安装git并关联github账号,通过github进行中转,拉取上面的项目信息,希望能够简便项目变更所带来的麻烦。
连接远程主机使用的工具是 Xshell
一、安装git
首先输入git命令查看git是否已经安装
root@wangjun:~# git
The program 'git' is currently not installed. You can install it by typing:
apt install git
系统提示git未安装,并提示安装方式,依照上面的提示输入命令:
root@wangjun:~# apt install git
注意: 这里使用的安装方式是安装方式,也可以使用源码安装等其他的方式,这里就不在介绍。
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-4.4.0-87 linux-headers-4.4.0-87-generic linux-image-4.4.0-87-generic
linux-image-extra-4.4.0-87-generic
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
git-man liberror-perl
Suggested packages:
git-daemon-run | git-daemon-sysvinit git-doc git-el