Loading

git - 报错信息汇总

使用过程中遇到的报错信息记录...

$ git add readme.md

fatal: not a git repository (or any of the parent directories)
# Git命令必须在Git仓库目录内执行(git init除外),在仓库目录外执行是没有意义的

fatal: pathspec 'readme.md' did not match any files
# 添加某个文件时,该文件必须在当前目录下存在
# 用 ls 或者 dir 命令查看当前目录的文件:
# 1. 文件是否存在
# 2. 是否写错了文件名

$ git push origin main
error: failed to push some refs to 'https://github.com/abeelan/abeelan.github.io.git'

# 原因,远程仓库有本地未同步的文件
$ git pull --rebase origin main
# 重新提交即可
$ git push origin main

remote: You are not allowed to push code to this project.
fatal: unable to access 'https://gitlab.joyame.com/test/sixdu_u2.git/': The requested URL returned error: 403

gitlab 提交一直提示权限不够,更新权限到主程序员即可。

On branch master
Changes not staged for commit:

推送不到远程仓库,提示该信息。

解决:git commit -am "message",添加一个 -a 参数,表示新增。

posted @ 2023-03-10 15:21  ABEELAN  阅读(15)  评论(0编辑  收藏  举报