git 常用指令
简介:收录一些常用的git指令,方便快速学习和查找
git init //初始化
git config --global user.email"123@1" //修改邮箱
git config --global user.name"userame" //修改用户名
git add . //添加所有文件到本地仓库
git commit -m "first commit" //提交信息,使用双引号
git remote add origin https://Suiyizhi12138/demo.git//绑定仓库 origin 就是你的仓库名
git push -u origin master //提交代码 master 是分支
git clone //下载项目
git confi list //查看配置 按q退出
// .gitnore 屏蔽文件
gite remote -v //查看绑定仓库
git remote remove origin //删除连接
git pull origin master//拉取仓库
参考博文:https://blog.youkuaiyun.com/weixin_43629813/article/details/113824388
官方文档:git文档
ssh key 更新解决方案:https://blog.youkuaiyun.com/qq_43705131/article/details/107965888
bug 记录
1.Updates were rejected because the tip of your current branch is behind
因为本地仓库落后于远程仓库需要git pull
git pull origin master -rebase
参考: https://blog.youkuaiyun.com/weixin_42310154/article/details/118676936