当前位置: 首页 > article >正文

[git操作] git创建仓库上传github报错

操作流程如下

  1. 使用 git init
  2. 使用 git remote add origin 项目ssh链接
  3. git add .

报错如下

Bus error (core dumped)

然后执行任何别的操作都会报错:

fatal: Unable to create 'path .. /.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 status 查看,之前的add操作确实没有成功:

On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        Checkpoints/
        Code/
        Data/
        Misc/
        Results/
        Scripts/

nothing added to commit but untracked files present (use "git add" to track)

按照它的提示,把 .git/index.lock 文件手动删掉,然后重新 git add . 就可以了。

修改本地master成为main

  • 参考:https://blog.csdn.net/jiahongfei1213895/article/details/128661543
git branch -m master main

然后拉取remote的仓库

git pull origin main

如果是新建仓库,可能会报错:efusing to merge unrelated histories这通常是因为本地分支上的代码和远程分支上的代码没有共同祖先,也就是说他们之间没有关联。要强制合并两个不相关的历史记录:

git pull origin main --allow-unrelated-histories

pull之后merge,merge之后commit修改

git commit -m  "your commit message"

push的方式

git push --set-upstream origin main # 如果第一次git push失败了,可以这么干

git限制了100MB的大小

所以注意要在 .gitignore 文件处设置好,不要上传大的文件

比如深度学习模型实验中需要忽略的文件,注意不要多加 ./ ,比如 ./Data/* 它还是会上传 Data 的!!!

# data files can't upload
**/__pycache__
Data/NpyData
Data/cuda_normalizers
Data/vahadane_images
Checkpoints
Results
wandb
Code/models/backbones/pretrained_weight

http://www.kler.cn/a/297290.html

相关文章:

  • 并发编程(六)
  • vue3 cookie 存取删数据
  • 镭速助力构筑ICT安全高效的大文件传输
  • 【android10】【binder】【2.servicemanager启动——全源码分析】
  • MySQL数据归档策略:实现定期数据维护与优化
  • 数据结构—单链表的基本操作
  • Vue3进阶:异步状态示例
  • Docker 学习 Day 1
  • springboot整合Logback
  • 千益畅行,共享旅游卡,引领旅游新潮流
  • “Jmeter-InfluxDB-Grafana“常见错误有哪些如何解决?
  • verilog报错:Illegal concatenation of an unsized constant. and 输入输出位宽不匹配
  • 安全服务面试-2
  • Spring Cloud LoadBalancer
  • 【QT Creator】基本使用
  • 在cscode中通过maven创建java项目
  • 免费 U 盘数据恢复 - 用 4 种免费方法从随身U 盘恢复文件
  • html备忘录
  • 个人信息记录安全:守护数字时代的隐私堡垒
  • smsp__inst_executed_pipe_fp64为什么对不上