• 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:Usersyourname.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 .       (“.”不要忘了)

  • 相关阅读:
    对象的存在是因为别人要用它
    图书馆借书程序我的分析
    版权迷思
    第四章 算法
    不可持续的天才教育
    第一章 你要做什么?
    win8 开发新格局分析
    水果机的几率设计
    我的理想
    windows 8,微软创新之路
  • 原文地址:https://www.cnblogs.com/51python/p/15488121.html
Copyright © 2020-2023  润新知