git 使用

git init 初始化

git add xxx.txt  添加文件

 git commit -m "xxxxx" 提交文件

git remote add <name> <url>  //添加远程 :(版本地址需要提前在网站上创建,并且之前要配置好ssh的key等,不再赘述。) 如:

git remote add origin https://gitee.com/sdgtxuyong/test.git

提交推送远程

git push -u origin master 提交远程   

git push --help,查看-u 的参数内容等同于 --set-upstream

只要提交过一次后,

再次git push ,即可,

不用在 remote add,和 push 的时候带参数 

原文地址:https://www.cnblogs.com/sdgtxuyong/p/14665743.html