git使用总结
最近喜欢上github,命令行果然简洁方便,决定总结一下自己的使用心得。(持续更新总结)
本地项目上传github
git config --global user.name
git config --global user.email
cd d:
mkdir bootstrap
cd bootstrap
//初始化版本仓库
git init
//新建readme文件
touch README
//将所有文件添加到上传队列
git add .
//提交缓存,并添加描述‘first commit’
git commit - m 'first commit'
//注意需提前建立好版本仓库
git remote add origin https://github.com/chne1218chen/bootstrap.git
//提交到github仓库
git push origin master
遇到问题
- Q1
error:failed to push som refs to ......
解决方法:
1、先输入 git pull origin master ,先把远程服务器github上面的文件拉下来
2、再输入git push origin master
- Q2
fatal: remote origin already exists.
解决方法:
1、先输入 git remote rm origin
2、再输入git remote add origin https://github.com/chne1218chen/bootstrap.git 就不会报错了!
获取项目
git clone https://github.com/chne1218chen/bootstrap.git
文章更新,请点击这里查看,实战记录,适合新手使用哦
本文提供了一套详细的Git使用教程,包括本地项目如何上传到GitHub、常见问题解决方案及如何从GitHub获取项目等内容,适合初学者快速掌握Git的基本操作。
1156

被折叠的 条评论
为什么被折叠?



