git创建远程仓库并上传文件

远程仓库已创建:


git clone xxxxxxxxxxxx

关联远程

git remote add origin ssh地址 // 链接远程仓库步骤1

git pull origin master //拉最新代码 (下载)

git add -A //提交所有文件改动

git commit -m "xx" //备注功能

git push origin master //推送到远程 (上传)

 

远程仓库未创建:

mkdir luffyapi
cd luffyapi
git init 
git add .
git commit -m "first commit"
git remote add origin https://gitee.com/liuqingzheng/luffyapi_s15.git
git push origin master

pull遇到错误:error: Your local changes to the following files would be overwritten by merge:

是保存本地修改

git stash git

pull origin master

git stash pop

 

否保存本地修改

git reset --hard

git pull origin master

posted @ 2021-01-24 17:11  Οo白麒麟оΟ  阅读(87)  评论(0编辑  收藏  举报