将文件传至GitHub

Git教程:

1、创建版本库

mkdir 文件名 :创建空目录
git init :将空目录变成可以管理的仓库

在这里插入图片描述

2、添加远程库

创建远程仓库:
在这里插入图片描述
在这里插入图片描述
然后根据上图提示在git bush上运行命令:
git remote add origin https://github.com/oouapatia/example.git
在这里插入图片描述

3、先将文件从工作区添加到暂存区

git add 文件名
在这里插入图片描述

出现的问题
fatal: Unable to create '.../.git/index.lock': File exists.

Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.
  • 解决办法:
    将.git文件夹下的index.lock删除
4、将文件仓库提交到仓库

git commit -m “备注”
在这里插入图片描述

出现的问题
*** Please tell me who you are.
Run
	git config --global user.email "you@example.com"
	git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.

由于重装系统或其他原因导致email与name丢失
解决办法:
(1)命令
重新设置姓名与邮箱:
git config --global user.name "name"
gitconfig --global user.email "email"
​参数–global : 表示这台计算机上所有的Git仓库都会使用这个配置
(2)修改文件
修改.git下的config文件,在最后添加

[user]
name = "name"
email = "email"
5、最后把推送到远程库

git push origin master
在这里插入图片描述

6、结果

在这里插入图片描述
上传了就长这样了,你的-m ""里的内容就在那红箭头那了,所以这个备注还是想想在打

7、删除库

点开设置:
在这里插入图片描述
设置往最下面滑,到这个地方:
在这里插入图片描述
最后再输一波密码就删除了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值