github如何上传代码到仓库(github提交代码步骤)

   发布日期:2025-02-23 23:37:04     手机:https://m.qqhuangye.com/yule/tag/2293.html     违规举报

github如何上传代码到仓库(github提交代码步骤)

上传文件到github

正常来说:

1.先在自己的github上创建一个仓库并且需要配置好ssh公钥

在用户目录打开git 的bash,然后输入指令ssh-keygen -t rsa -C “youremail” 就会生成一个.ssh隐藏目录

然后里面两个文件 一个是id_rsa私钥 一个是id_rsa.pub公钥。

将公钥添加到github上面,这里不多说了,之后按照常规操作来。

2.常规操作

#这里是写一个字符串到README.md文件里(如果你创建的那个仓库没有点击初始化REAME.md的话,可以执行这个操作)echo "# face-recognition" >> README.md#初始化git init#添加自定义文件到暂存区git add README.md#提交git commit -m "first commit"#绑定远程仓库 就是你之前在github上创建的仓库地址git remote add origin https://github.com/gkho/face-recognition.git#推送到远程仓库git push -u origin master 坑:

如果你初始化仓库的时候点击了Initialize this repository with a README那么需要先git pull

git pull origin #然后合并本地仓库再推送 git merge origin master git push -u origin master github解决大文件的上传 #设置缓存 这是500mbgit config http.postBuffer 524288000 # 1、安装git-lfsgit lfs install# 2、跟踪一些文件,那么上传大小就会变少 比如可以跟踪py结尾的文件 git lfs track "*.py"git lfs track "你要跟踪的大文件的拓展名"# 3、push常规操作git add 你要上传的大文件git commit -m "add large file"git push -u origin master

可能还是会错

那么输入

git config lfs.https://github.com/468336329Zc/face-recognition.git/info/lfs. locksverify false#然后再次pushgit push -u origin master
 
 
本文地址:https://qqhuangye.com/yule/tag/2293.html,转载请注明出处。"error":400,"message":"over quota","url:"https://qqhuangye.com/yule/tag/2293.html
 
更多>同类娱乐

推荐图文
推荐娱乐
点击排行
网站首页  |  关于我们  |  联系方式  |  使用协议  |  版权隐私  |  网站地图  |  违规举报  |  蜀ICP备18010318号-2  |  SiteMaps  |  BaiDuNews
Processed in 0.373 second(s), 8 queries, Memory 0.52 M