1.如果没有安装git命令
执行 命令sudo apt-get install git
安装git
2.使用git clone 命令从服务器上下初始代码
git clone ssh://xxxxxx
在你的当前路径下将多出一个文件夹
将你要上传的代码拷贝到该文件夹下
如要将如上C代码上传
使用git add temper_*
git commit -m "Add tlv"
git commit -m " xxx"相当于给你提交的代码取一个别名
如果你是第一次提交需要配置用户名和邮箱
git config --global user.email "你的邮箱"
git config --global user.name "你的名字"
再使用命令git commit -m "Add tlv"
最后:使用git push
命令把文件提交到服务器上
***注意:***必须使用git push 才能提交到服务器上不然代码还在本地并没有上传到服务器端
在服务器上刷新就可以看到你提交的代码