longtaozz / my_img

图片资源
0 stars 0 forks source link

提交文件,以免忘掉 #1

Open longtaozz opened 5 years ago

longtaozz commented 5 years ago

提交README文件

echo "# my_img" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/longtaozz/my_img.git
git push -u origin master

上传项目

//添加文件夹或文件
git add .
//输入本次的提交说明,准备提交暂存区中的更改的已跟踪文件,单引号内为说明内容
git commit -m 'first_commit'
//关联远程仓库
//如果关联出错fatal: remote origin already exists,则用git remote rm origin关联
git remote add origin https://github.com/longtaozz/my_img.git
//提交,和上面一样(error:failed to push som refs to.......则执行git pull origin master,重新拉下并上传)
git push -u origin master
强制推送
git push -u origin master -f

重新关联

git remote add origin https://github.com/longtaozz/my_img.git
git push -u origin master

修改远程库地址

//先清除掉已经绑定的,不然会报错fatal: remote origin already exists.
git remote rm origin
git remote add origin https://github.com/longtaozz/my_img.git
longtaozz commented 5 years ago

git clone ...拉取代码