Tag Archives: git

jenkenis ERROR: Error fetching remote repo ‘origin‘ [How to Solve]

explain:

During the work, Jenkins made such a mistake in pulling gitlab as below:

jenkenis ERROR: Error fetching remote repo ‘origin‘

 

The pipeline command is as follows:

pipeline {
    agent any

  options {
      timeout(time: 2, unit: 'HOURS') 
  }
  
    stages {
        stage('Fetch code') {
            steps {
                echo 'Hello World'
                checkout([$class: 'GitSCM', branches: [[name: '*/master']],
                doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', depth: 1, noTags: true, reference: '', shallow: true, timeout: 120]], 
				submoduleCfg: [],userRemoteConfigs: [[credentialsId: '49352c9d-3f03-4271-8b60-2fddab3ca058', url:
                '[email protected]']]])
                
            }
        }
    }
}

Solution:

cd to the specified directory under the corresponding workspace, such as workspace\test_pipelinescript here, and manually clone the project to the local through git clone. It should be noted here:

1. Delete the .git folder in the test_pipelinescript directory;

2. Copy everything in the test_jenkins directory to test_pipelinescript

3. Restart Jenkins service.

Enter services.msc through Win + R, find Jenkins service and stop –> Start

4. Re-trigger Jenkins to execute again, and it’s OK.

github Error: Logon failed, use ctrl+c to cancel basic credential prompt.

Logon failed, use ctrl+c to cancel basic credential prompt.

Today, when updating something on gitHub, the password is correct, and you can’t log in more than push. According to the prompt, you find that the previous configuration doesn’t work. The updated configuration is as follows:



set it in the individual

Check these

Generate a token and record it

Continue to push. Enter the password of the account when logging in for the first time, and enter the generated token for the second time

successfully push

[Solved] import cv2 Error: ImportError: libGL.so.1: cannot open shared object file: No such file or directory

Execute the following command:

    import cv2
  File "/appletree/miniconda3/envs/yyp_pytorch/lib/python3.7/site-packages/cv2/__init__.py", line 5, in <module>
    from .cv2 import *
ImportError: libGL.so.1: cannot open shared object file: No such file or directory

Reason: libGL.so.1 is missing.
Solution:
execute the following command after pip install opencv-python

pip install opencv-python-headless

[Solved] LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443

There is an error when using git to pull the GitHub code base

LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443

The solution is as follows:
1 Cancel global proxy first:

git config --global --unset https.proxy
git config --global --unset http.proxy

2. Configure global agent:

git config --global http.https://github.com.proxy socks5://127.0.0.1:1080 
git config --global https.https://github.com.proxy socks5://127.0.0.1:1080

Note that 1080 is changed to the port number of its own proxy service

[Solved] error: Pulling is not possible because you have unmerged files

Scene

For the same repository, Jane and Flora each pulled code from the master branch of the repository.
Jane commits the modified code to the master branch first.
Flora then commits the modified code to the master branch, and finds that the remote repository master branch code has changed due to Jane’s commit, which prompts “Updates were rejected because the tip of your current branch is behind” when committing. branch is behind”

When Flora tried to pull the master branch code for merging, it prompted “error: Pulling is not possible because you have unmerged files”

Solution:

git add -u 
git commit -m "xxxx" 
git pull
git push 

First, the file will be stored in the staging area and then commit the comments, and then git pull will not report an error
This kind of error is generally thought to have a conflict file, need to resolve the conflict or merge files, after the solution or merge need to recommit, not limited to pulling

[Solved] ERROR: commit 60acc70: missing Change-Id in message footer

When merging multiple commits, I accidentally deleted the Change-Id, resulting in push failure

remote: Processing changes: refs: 1        
remote: Processing changes: refs: 1, done            
remote: ERROR: commit 60acc70: missing Change-Id in message footer        
remote: 
remote: Hint: to automatically insert a Change-Id, install the hook:        
remote:   gitdir=$(git rev-parse --git-dir); scp -p -P 29418 [email protected]:hooks/commit-msg ${gitdir}/hooks/        
remote: and then amend the commit:        
remote:   git commit --amend --no-edit        
remote: Finally, push your changes again        
remote: 
error: failed to push some refs to 'ssh://[email protected]/project'

Solution:

1. Use the amend option to generate a Change-Id:
If the missing Change-Id is the last (head) commit, use the following command to fix it:

$ git commit –amend
This command will open the default commit message editor, usually vi.

At this point, you don’t need to change anything, just save and exit (:wq).

If you check the git log again, you will see that the missing Change-Id has been filled in. Just git push again.

2. reset method
The reset command undoes your commit to the workspace, and you can recommit

If the missing Change-Id commit is the second commit in your git log, you can use the git reset command to roll back your local branch to that commit.

First, run git log, find the commit with the missing Change-Id, and copy its commit-id:

Find the second commit that is missing the Change-Id. Reset the code to that commit, and execute amend:

$ git reset 1a9096a34322885ac101175ddcac7dab4c52665d
$ git commit --amend

The next step is to recommit the code that was undone by git reset, and then push it:

$ git add ......
$ git commit -m "The log you Submitted"
$ git push review HEAD:refs /for/master
 

Reference link: https://blog.csdn.net/liuxu0703/article/details/54343096

vscode git error: would clobber existing tag [How to Solve]

Using vscode’s own git interface to operate pull, there may be an error about the tag would clobber existing tag, resulting in the inability to pull

Solution:

1. Type git pull directly in terminal to finish pulling the code. Although the code is pulled, the vscode git tool still does not work.
2. Type git fetch –tags -f in terminal to force the local code tag to be updated first. Then use vscode’s git tools to pull the code.

[Solved] git Error: error: dst refspec v0.10.2 matches more than one

Problem description

If the tag and heads have the same name, an error will be reported

error: dst refspec v0. 10.2 matches more than one

Problem analysis

refs/heads/* is the branch name refs/tags/* is the tag name refs/remotes/* is the remote track name

When naming heads, it generally uses main, master, that is refs/heads/Master, refs/heads/main
when naming tags, it usually uses v0.1, v0. 2, i.e. refs/tags/v1.0

When you execute git push origin master, because Master is generally only in heads, not in tags, GIT can directly find the branch you want to push.

But here:

git LS remote the results are as follows:

61d10100326130d2eceee85167d5ec2d9970ebbe        refs/heads/seq_task
4ee9724f3a6a47134483e4955c688f4f34432ee0        refs/heads/simulastsharedtask
83e615d66905b8ca7483122a37da1a85f13f4b8e        refs/heads/v0.10.2
bdf09e1321a77252835550e84d73ad1bb3f3173c        refs/heads/xlmr_benchmark
3e5a2739bce92b2516d060959a1aa3dd51d221dc        refs/tags/v0.10.0
8a0b56efeecba6941c1c0e81a3b86f0a219e6653        refs/tags/v0.10.1
83e615d66905b8ca7483122a37da1a85f13f4b8e        refs/tags/v0.10.2

Twice v0.10.2 , corresponding to tags and heads respectively, so an error is reported.

Solution:

    1. change the name of the branch’s heads or tags (the change method is Google). Push

git push origin refs/heads/Main: refs/tags/V1 with the full name of the branch 2 

Reference resources:

https://stackoverflow.com/questions/70584317/git-push-error-dst-refspec-refs-heads-main-matches-more-than-one