Live2D

git 问题整理

1、上传代码/拉取代码报错:remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.

  秘钥过期,把本地git公钥配制到gitlab中

  1)生成秘钥

    ssh-keygen -t rsa -C "example@qq.com"     替换成你的邮箱

  2)拷贝公钥

    上一步生成的秘钥有两个,一个是id_rsa ,一个是id_rsa.pub ,都放在C:\Users\yourname\.ssh\下

    打开id_rsa.pub,拷贝里面的内容

    类似于下面的这个:

            

 

 

   3)添加到gitlab中

    打开gitlab,登录后,进入项目》点击个人头像》setting》ssh and GPG key》点击new ssh key 

        

 

     填入标题(自己随便写一个),然后复制刚才拷贝的id_res.pub内容到下面的key中,点击添加就可以了。

      

 

 

2、运行 git pull --rebase origin master 报错:error: cannot pull with rebase: You have unstaged changes.

  这个是没有commit 代码就直接拉取了:

  先运行 git commit -m "本次修改了一个bug"

 

 

 

3、运行git commit -m "232"报错:Changes not staged for commit:

         (use "git add <file>..." to update what will be committed)
    (use "git restore <file>..." to discard changes in working directory)
    modified: src/main/java/com/example/。。。。

    no changes added to commit (use "git add" and/or "git commit -a")

 

  这个是没有add本地修改的代码

    运行 git add .       (“.”不要忘了)

 

posted @   -涂涂-  阅读(101)  评论(0编辑  收藏  举报
编辑推荐:
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
阅读排行:
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
点击右上角即可分享
微信分享提示