使用git上传项目到Gitee


常用命令

//配置账号
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

在这里插入图片描述

(1)解决方案:把下面的勾勾去掉

在这里插入图片描述

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值