文章目录
常用命令
//配置账号
git config --global user.name "你Gitee/github的用户名"
//配置邮箱(邮箱必须公开)
git config --global user.email "你Gitee/github绑定的邮箱"
//初始化git
git init
//将工作区所有文件提交到暂存区
git add .
//把缓冲区的文件提交到本地仓库 :fire: 表情
git commit -m ':fire:提交'
//查看状态
git status
//本地仓库提交到远程仓库
//第一次提交
git push -u 仓库git链接 master
//以后提交
git push -u origin master
//重新关联远程仓库
git remote add origin 远程库地址
//拉取远程仓库文件
git pull origin master
//删除暂存区所有文件
git rm -r --cached .
//查看暂存区文件
git ls-files
//解除SSL认证
git config --global http.sslVerify "false"
前言
记录一下自己第一次使用git上传项目到Gitee防止以后忘记(Windows)
一、安装git
官网传送门
这里我用的是Windows版的,下载安装包后直接安装就可以了,这里有个诀窍一定要注意:安装的时候闭着眼睛下一步。
二、上传流程
1.在需要上传的文件夹目录右击选择Git Bash Here
2.输入命令(每输入一条回车)
git config --global user.name "你Gitee的用户名"
git config --global user.email "你Gitee绑定的邮箱"
git init
注意这里(.)点的前面有一个空格
git add .
git commit -m "提交"
3.效果
4.Gitee上创建一个仓库并复制链接
5.登录Gitee并push项目到仓库
git push -u 上一步复制的链接 master
6.效果
7.上传成功
三、可能出现的问题
(1)remote: error: GE007: Your push would publish a private email address.
info: detecting host provider for 'https://gitee.com/'...
info: detecting host provider for 'https://gitee.com/'...
Enumerating objects: 50, done.
Counting objects: 100% (50/50), done.
Delta compression using up to 6 threads
Compressing objects: 100% (46/46), done.
Writing objects: 100% (50/50), 23.08 MiB | 814.00 KiB/s, done.
Total 50 (delta 6), reused 0 (delta 0), pack-reused 0
remote: Powered by GITEE.COM [GNK-6.1]
remote: error: GE007: Your push would publish a private email address.
remote: You can make your email public or disable this protection by visiting:
remote: https://gitee.com/profile/emails
remote: error: hook declined to update refs/heads/master
To https://gitee.com/molihuan/bilibili-ffmpeg.git
! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'https://gitee.com/molihuan/bilibili-ffmpeg.git