首页 > 其他分享 >Git error

Git error

时间:2023-11-04 13:56:41浏览次数:30  
标签:git java thread create Git mode error 100644

error

error: failed to push some refs to 'remote_repository_address'

问题/原因

如果不确定本地版本是否是最新,最好先 git pull

image

Git仓库中已经有一部分代码,所以它不允许你直接把你的代码覆盖上去。
远程仓库和本地仓库存在差异。
一般都是因为你在码云创建的仓库有ReadMe文件,而本地没有,造成本地和远程的不同步,

解决方法:

方法一、同步

1、git pull origin master --allow-unrelated-histories //把远程仓库和本地同步,消除差异
2、重新add和commit相应文件
3、git push origin master
4、此时就能够上传成功了

如果只是因为本地没有ReadMe文件,那么就在本地生成一个

git pull --rebase origin master  //本地生成ReadMe文件
git push origin master

方法二:强推

即利用强覆盖方式用你本地的代码替代git仓库内的内容

git push -f origin master

该命令会强制上传覆盖远程文件,慎用
方法三、

先把git的东西fetch到你本地然后merge后再push

git fetch
git merge

参考文档:

git SSL certificate problem unable to get local issuer certificate

这个问题是由于没有配置信任的服务器HTTPS验证。默认,cURL被设为不信任任何CAs,就是说,它不信任任何服务器验证。只需要执行下面命令就可以解决:

$ git config --global http.sslVerify false

git 中文文件名乱码

$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        deleted:    "../Git/Windows Git \344\271\261\347\240\201.md"

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        "../Git/Git \344\271\261\347\240\201.md"

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

liuzonglin@LAPTOP-CGO0UV3J MINGW64 /d/.github/.doc/Maven (master)
$ git config --global core.quotepath false
liuzonglin@LAPTOP-CGO0UV3J MINGW64 /d/.github/.doc/Maven (master)
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        deleted:    ../Git/Windows Git 乱码.md

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        ../Git/Git 乱码.md

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

liuzonglin@LAPTOP-CGO0UV3J MINGW64 /d/.github/.doc/Maven (master)

HEAD detached from origin/master

点击查看错误示例
liuzonglin@LAPTOP-CGO0UV3J MINGW64 /d/.github/java-dome ((a0734b5...))                                                                                                                                                                              
$ git commit -m "日常更新"
HEAD detached from origin/master
nothing to commit, working tree clean

liuzonglin@LAPTOP-CGO0UV3J MINGW64 /d/.github/java-dome ((a0734b5...))                                                                                                                                                                              
$ ^C

liuzonglin@LAPTOP-CGO0UV3J MINGW64 /d/.github/java-dome ((a0734b5...))                                                                                                                                                                              
$ git branch v

liuzonglin@LAPTOP-CGO0UV3J MINGW64 /d/.github/java-dome ((a0734b5...))                                                                                                                                                                              
$ git branch -v
* (HEAD detached from origin/master) a0734b5 日常更新
  master                             89ecd4a new file dubbo-api-task  deleted springboot-rabbitmq
  v                                  a0734b5 日常更新
liuzonglin@LAPTOP-CGO0UV3J MINGW64 /d/.github/java-dome ((a0734b5...))                                                                                                                                                                              
$ git checkout master
Previous HEAD position was a0734b5 日常更新
Switched to branch 'master'
Your branch is up to date with 'origin/master'.

liuzonglin@LAPTOP-CGO0UV3J MINGW64 /d/.github/java-dome (master)                                                                                                                                                                                    
$ git merge a0734b5
Updating 89ecd4a..a0734b5
Fast-forward
 .gitignore                                         |   3 +-                                                                                                                                                                                        
 data-structure/README.md                           |   5 +                                                                                                                                                                                         
 data-structure/build.gradle                        |  19 ++                                                                                                                                                                                        
 data-structure/gradle/wrapper/gradle-wrapper.jar   | Bin 0 -> 59821 bytes
 .../gradle/wrapper/gradle-wrapper.properties       |   5 +                                                                                                                                                                                         
 data-structure/gradlew                             | 234 +++++++++++++++++++++                                                                                                                                                                     
 data-structure/gradlew.bat                         |  89 ++++++++                                                                                                                                                                                  
 data-structure/settings.gradle                     |   2 +                                                                                                                                                                                         
 .../src/main/java/org/example/common/Utils.java    |  61 ++++++                                                                                                                                                                                    
 .../main/java/org/example/heap/HeapShiftUp.java    |  65 ++++++                                                                                                                                                                                    
 .../src/main/java/org/example/heap/MaxHeap.java    |  37 ++++                                                                                                                                                                                      
 .../main/java/org/example/sort/InsertionSort.java  |  36 ++++                                                                                                                                                                                      
 .../main/java/org/example/sort/SelectionSort.java  |  35 +++
 .../dubbo-spring-boot-demo-consumer/pom.xml        |  19 ++                                                                                                                                                                                        
 .../dubbo-spring-boot-demo-interface/pom.xml       |  19 ++                                                                                                                                                                                        
 .../dubbo-spring-boot-demo-provider/pom.xml        |  19 ++                                                                                                                                                                                        
 dubbo-spring-boot-demo/pom.xml                     |  67 ++++++                                                                                                                                                                                    
 .../example/sys/controller/LoginController.java    |   1 -                                                                                                                                                                                         
 thread/README.md                                   |   1 +                                                                                                                                                                                         
 thread/build.gradle                                |  19 ++                                                                                                                                                                                        
 thread/gradle/wrapper/gradle-wrapper.jar           | Bin 0 -> 59821 bytes
 thread/gradle/wrapper/gradle-wrapper.properties    |   5 +                                                                                                                                                                                         
 thread/gradlew                                     | 234 +++++++++++++++++++++                                                                                                                                                                     
 thread/gradlew.bat                                 |  89 ++++++++                                                                                                                                                                                  
 thread/settings.gradle                             |   2 +                                                                                                                                                                                         
 .../java/org/example/Number/ThreadPoolTest.java    |  67 ++++++                                                                                                                                                                                    
 .../java/org/example/sync/SaleTicketDemo3.java     |  36 ++++                                                                                                                                                                                      
 .../java/org/example/sync/SaleTicketDemo4.java     |  31 +++                                                                                                                                                                                       
 .../java/org/example/sync/SaleTicketDemo5.java     |  61 ++++++                                                                                                                                                                                    
 .../main/java/org/example/thread/LifeCycle.java    |  43 ++++                                                                                                                                                                                      
 thread/src/main/java/org/example/thread/Main.java  |  17 ++                                                                                                                                                                                        
 .../main/java/org/example/thread/MyRunnable.java   |  20 ++                                                                                                                                                                                        
 .../src/main/java/org/example/thread/MyThread.java |  37 ++++                                                                                                                                                                                      
 .../java/org/example/thread/ThreadStateChange.java |  33 +++                                                                                                                                                                                       
 .../java/org/example/volatiles/volatileTest.java   |  49 +++++                                                                                                                                                                                     
 35 files changed, 1458 insertions(+), 2 deletions(-)
 create mode 100644 data-structure/README.md
 create mode 100644 data-structure/build.gradle
 create mode 100644 data-structure/gradle/wrapper/gradle-wrapper.jar
 create mode 100644 data-structure/gradle/wrapper/gradle-wrapper.properties
 create mode 100644 data-structure/gradlew
 create mode 100644 data-structure/gradlew.bat
 create mode 100644 data-structure/settings.gradle
 create mode 100644 data-structure/src/main/java/org/example/common/Utils.java
 create mode 100644 data-structure/src/main/java/org/example/heap/HeapShiftUp.java
 create mode 100644 data-structure/src/main/java/org/example/heap/MaxHeap.java
 create mode 100644 data-structure/src/main/java/org/example/sort/InsertionSort.java
 create mode 100644 data-structure/src/main/java/org/example/sort/SelectionSort.java
 create mode 100644 dubbo-spring-boot-demo/dubbo-spring-boot-demo-consumer/pom.xml
 create mode 100644 dubbo-spring-boot-demo/dubbo-spring-boot-demo-interface/pom.xml
 create mode 100644 dubbo-spring-boot-demo/dubbo-spring-boot-demo-provider/pom.xml
 create mode 100644 dubbo-spring-boot-demo/pom.xml
 create mode 100644 thread/README.md
 create mode 100644 thread/build.gradle
 create mode 100644 thread/gradle/wrapper/gradle-wrapper.jar
 create mode 100644 thread/gradle/wrapper/gradle-wrapper.properties
 create mode 100644 thread/gradlew
 create mode 100644 thread/gradlew.bat
 create mode 100644 thread/settings.gradle
 create mode 100644 thread/src/main/java/org/example/Number/ThreadPoolTest.java
 create mode 100644 thread/src/main/java/org/example/sync/SaleTicketDemo3.java
 create mode 100644 thread/src/main/java/org/example/sync/SaleTicketDemo4.java
 create mode 100644 thread/src/main/java/org/example/sync/SaleTicketDemo5.java
 create mode 100644 thread/src/main/java/org/example/thread/LifeCycle.java
 create mode 100644 thread/src/main/java/org/example/thread/Main.java
 create mode 100644 thread/src/main/java/org/example/thread/MyRunnable.java
 create mode 100644 thread/src/main/java/org/example/thread/MyThread.java
 create mode 100644 thread/src/main/java/org/example/thread/ThreadStateChange.java
 create mode 100644 thread/src/main/java/org/example/volatiles/volatileTest.java

liuzonglin@LAPTOP-CGO0UV3J MINGW64 /d/.github/java-dome (master)                                                                                                                                                                                    
$ git branch -v
* master a0734b5 [ahead 1] 日常更新
  v      a0734b5 日常更新

liuzonglin@LAPTOP-CGO0UV3J MINGW64 /d/.github/java-dome (master)                                                                                                                                                                                    
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

liuzonglin@LAPTOP-CGO0UV3J MINGW64 /d/.github/java-dome (master)                                                                                                                                                                                    
$ git push
Enumerating objects: 76, done.
Counting objects: 100% (76/76), done.
Delta compression using up to 12 threads
Compressing objects: 100% (45/45), done.
Writing objects: 100% (65/65), 69.56 KiB | 7.73 MiB/s, done.
Total 65 (delta 9), reused 0 (delta 0), pack-reused 0
remote: Powered by GITEE.COM [GNK-6.4]
To https://gitee.com/liuzonglin1/java-dome.git
   89ecd4a..a0734b5  master -> master

liuzonglin@LAPTOP-CGO0UV3J MINGW64 /d/.github/java-dome (master)                                                                                                                                                                                    
$ 

参考文档:

标签:git,java,thread,create,Git,mode,error,100644
From: https://www.cnblogs.com/liuzonglin/p/17809247.html

相关文章

  • Git
    Git常用命令速查表Git全局设置:$gitconfig--globaluser.name"user_name"#设置用户签名$gitconfig--globaluser.email"user_email"#设置用户邮箱说明:签名的作用是区分不同操作者身份。用户的签名信息在每一个版本的提交信息中能够看到,以此确认本......
  • Git 精简快速使用以及官方文档进阶总结
    ​ 安装Git忽略,自行搜索 新建项目,或者在仓库拉取项目,进入到项目目录Github给出的引导,新项目和旧项目echo"#testgit">>README.mdgitinitgitaddREADME.mdgitcommit-m"firstcommit"gitbranch-Mmaingitremoteaddoriginhttps://github.com/9sis/tes......
  • CF1866D Digital Wallet 题解
    Problem-1866D-CodeforcesDigitalWallet-洛谷不妨为选数钦定一个顺序:不同行之间无影响,列从左到右取一定不劣。设计状态:设\(dp_{i,j}\)表示前\(i\)次操作操作到第\(j\)列的最大答案转移:因为对于同一列不互相影响,因此枚举这一列取\(c\)个数,显然取这一列数......
  • 黑马git学习笔记
    安装及配置1.安装淘宝镜像,选择最新版本即可https://registry.npmmirror.com/binary.html?path=git-for-windows/根据系统选择对应的版本2.配置用户名密码gitconfig--globaluser.name[用户名]#配置用户名gitconfig--globaluser.email[邮箱]#配置邮箱查看配......
  • Visual Studio使用Git忽略不想上传到远程仓库的文件
    前言作为一个.NET开发者而言,有着宇宙最强IDE:VisualStudio加持,让我们的开发效率得到了更好的提升。我们不需要担心环境变量的配置和其他代码管理工具,因为VisualStudio有着众多的拓展工具。废话不多说,直接进入正题。我们日常在使用VisualStudio开发相关的.NET项目时,经常会发现刚......
  • 遇到的问题 vscode 连接远程主机报错 `Resolver error: Error: Got bad result from i
    解决方案我发现我的cmd.exe崩溃了(它会弹出并立即关闭)我将注册表值Autorun 从更改HKEY_CURRENT_USER\Software\Microsoft\CommandProcessor为ifexists空白(如此链接所示)。我的cmd.exe工作正常,远程SSH再次工作再次链接上远程主机......
  • Linux系统bash文件运行后出现error: unrecognized arguments中command not found的解
    跑了一个代码,如下图所示,我在配置完环境后运行了bash文件,结果是出现了commandnotfound,稍微找了一下解决方案,最后是在github上一个的仓库问题找到了思路,链接如下:为什么运行bashtrain.sh时一直说我的参数有错?·Issue#450·THUDM/ChatGLM-6B(github.com) 在我的文件是在......
  • 如何把一个本地项目上传到git
    1、在本地创建一个版本库(即文件夹),通过gitinit把它变成Git仓库;2、把项目复制到这个文件夹里面,再通过gitadd.把项目添加到仓库;3、再通过gitcommit-m"注释内容"把项目提交到仓库;4、在Github上设置好SSH密钥后,新建一个远程仓库,通过gitremoteaddorigin远程仓库ssh地址  ......
  • prometheus Error on ingesting samples that are too old or a re too far into the
    目录prometheusErroroningestingsamplesthataretoooldoraretoofarintothefuture磁盘问题时间问题版本问题历史prometheus旧数据prometheusErroroningestingsamplesthataretoooldoraretoofarintothefuture之前在自己服务器上用docker部署过一个p......
  • 没有在 SCM 配置或者插件中的 Git 存储库配置错误 jenkins
    已返回默认值没有在SCM配置或者插件中的Git存储库配置错误选项"使用仓库"设置为:"http://192.168.18.142/kmyl/km-manage.git"请检查配置pipeline{agentanystages{stage('Checkout'){steps{gitcredentialsId:'......