Tag Archives: git

Error in publishing project with Maven in idea. Git directory is not found! Please specify a valid

1、 Problem description

1. After using idea development tool and git to download the project, the folder was deleted because of GIT, resulting in problems in Maven packaging
picture display

2、 Solutions

1. Download the GIT project again
2. Retrieve the deleted git folder, which can be

[Solved] IDEA Import springboot Project Error: Cannot resolve plugin org.springframework.boot:spring-boot-maven-plugin:<unknown>

Today, after pulling the springboot project from gitee, I found that idea directly reported an error. The error is as follows:

Cannot resolve plugin org.springframework. boot:spring-boot-maven-plugin :

At first, I thought it was an error in the project. Later, baidu found that the default Maven configuration file and the default local warehouse address were used in the configuration of the project.

resolvent:

Open file — & gt; Settings –> Build, Execution, Deploymen –> Build Tools –>   Maven, find the user Maven configuration file and local warehouse address, and modify it to the local configuration file path and warehouse address.

Before revision:

After modification:

Refresh Maven again and solve the problem

How to solve the problem of “please enter a commit message to explain why this merge is necessary” when git merges branches?

resolvent:

1. In case of the above situation, press the “ese” exit key in the upper left corner of the keyboard
2. Enter “: WQ”, pay attention to the colon in English input status, and then press “enter”( I think this method is good. What does “WQ” mean???Learn Linux operating system command: mandatory write file and exit.)

Git Clone RPC failed;curl 18 transfer closed with outstanding read data remaining

Git clone times RPC failed; Curl 18 transfer closed with outstanding read data remaining error

Reason 1: buffer overflow

Solution: command line input

git config http.postBuffer 524288000

If clone still fails to execute the above command, consider possible reason 2: slow network download speed

Solution: command line input

git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999

If clone still fails, shallow clone first, and then update the remote database to the local database

git clone --depth=1 http://gitlab.xxx.cn/yyy/zzz.git
git fetch --unshallow

Solve git upload file error [rejected] master -> master (fetch first) error: failed to push some refs to ‘

When push is executed, an error will be reported. The error code is as follows:

$ git push -u origin master
To gitee.com:backspacegit/aafdajs.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'gitee.com:backspacegit/aafdajs.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

This problem occurs because the readme.md file in GitHub is not in the local code directory. You can merge the code with the following command

git pull --rebase origin master

Then execute the statement

git push -u origin master

Done!

Git command line configuration and configuration file to solve clone error libressl_ connect: SSL_ ERROR_ SYSCALL in connection to github. com:443

Intro

When clone comes from a GitHub warehouse, an error is reported as follows:

leung@wuyujin coderepo % git clone https://github.com/spring-guides/gs-consuming-web-service.git
Cloning into 'gs-consuming-web-service'...
fatal: unable to access 'https://github.com/spring-guides/gs-consuming-web-service.git/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 
leung@wuyujin coderepo % git clone https://github.com/spring-guides/gs-consuming-web-service.git
Cloning into 'gs-consuming-web-service'...
fatal: unable to access 'https://github.com/spring-guides/gs-consuming-web-service.git/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 
leung@wuyujin coderepo % 

Core error: libressl_ connect: SSL_ ERROR_ SYSCALL in connection to github. com:443

It’s about SSL authentication.

to configure

The GIT configuration of the current user will be written in the . Gitconfig configuration file in the current user directory (if there is no new touch ~ /. Gitconfig )
take user wuyujin as an example, the full path of GIT configuration file is:
windows: C:
linux: /home/wuyujin /. Gitconfig
MacBook: /users/wuyujin /. Gitconfig

Git can be configured in two ways:
through the command line setting, the corresponding configuration items will be automatically written to the configuration file (premise: you know how to write the command)
directly modify the configuration file (premise: you know the format/rules of the configuration file)

Command required:

git config --global http.sslVerify false
git config --global https.sslVerify false

The effect is that the configuration file is written as follows:

[http]
        sslVerify = false
[https]
        sslVerify = false

In addition, user. Name user. Email and other parameters can be set (not necessary here).

shell


leung@wuyujin coderepo % git config --global http.sslVerify false
leung@wuyujin coderepo % git config --global https.sslVerify false

leung@wuyujin coderepo % more ~/.gitconfig 

[http]
        sslVerify = false
[https]
        sslVerify = false
leung@wuyujin coderepo % 

Once again, clone, success.

Another possibility

When you clone a warehouse, open a new window clone another window. report errors.

One clone at a time will not report an error.

That is: parallel clone -- & gt; Serial clone

SSL_ERROR_SYSCALL in connection to github.com:443

Project scenario:

Mac uses git push or hexo deploy to push GitHub

Problem Description:

Bug contains

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

Cause analysis:

Because the agent is attached locally, you can clone
but when pushing, you need to attach the agent to the terminal


Solution:

vim ~/.gitconfig

View the port of the native agent and replace the following XXXX

[http]
	proxy = socks5://127.0.0.1:xxxx
[https]
	proxy = socks5://127.0.0.1:xxxx

You can also push by turning off the agent and accessing it normally

Git pull and Git pull origin master Warning: Pulling without specifying how to reconcile divergent branches

Git pull and git pull origin master report the following warning

hint: Pulling without specifying how to reconcile divergent branches is
hint: discouraged. You can squelch this message by running one of the following
hint: commands sometime before your next pull:
hint: 
hint:   git config pull.rebase false  # merge (the default strategy)
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
hint: 
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.

terms of settlement:

$ git config pull.ff false
$ git config --global pull.rebase false

Warning copy disappears

remote: XXX Incorrect username or password (access token) fatal: Authentication failed for XXX

Abnormal information  

remote:  Incorrect username or password (access token) fatal: Authentication failed for 'https://gitee.com/mrxlh/interview.git/'

You can reset the user name and password with the following command:  

git config --system --unset credential.helper

When you push again  

git push -u origin master

Just input the user name and password corresponding to cloud gitee

 

Using jgit to report errors: the solution of algorithm negotiation failure

In today’s Java project, when using the jgit library to pull the remote code with SSH protocol, we encountered a lot of errors and stepped on a lot of holes to solve the problem. I’d like to record it here to help you
first of all, let’s talk about the use environment:

    1. there is no problem for the code to run on the Linux server. You can use SSH to pull the code. The local MacBook can pull code with SSH, but not with java code

Problem solving

        1. code error:

      com.jcraft.jsch.jschexception: algorithm negotiation failure

      1. this means that the algorithm negotiation fails, and SSH communication protocol has a stage of secret agreement and algorithm negotiation, in which both parties negotiate the final algorithm according to the algorithm supported by the local end and the opposite end. Different versions of openssh have different default algorithm lists, which may lead to the failure of algorithm negotiation. Use SSH – version to view the current openssh version
$ ssh -Version
OpenSSH_7.9p1, LibreSSL 2.7.3

View_ Protocol used in RSA private key file header

-----BEGIN OPENSSH PRIVATE KEY-----

Use SSH keygen - M PEM - t RSA to generate old format keys

-----BEGIN RSA PRIVATE KEY-----

When configuring the newly generated public key of SSH in gitlab repository settings in Git clone repository, specify the SSH private key file

private String private_key = "/Users/wang/.ssh/y";
SshSessionFactory sshSessionFactory = new JschConfigSessionFactory() {
            @Override
            protected void configure(OpenSshConfig.Host host, Session session) {
                session.setConfig("StrictHostKeyChecking", "no");
            }

            @Override
            protected JSch createDefaultJSch(FS fs) throws JSchException {
                JSch sch = super.createDefaultJSch(fs);
                sch.addIdentity(private_key); 
                return sch;
            }
        };

        Git git = Git.cloneRepository()
                .setURI(gitUrl)
                .setTransportConfigCallback(transport -> {
                    SshTransport sshTransport = (SshTransport) transport;
                    sshTransport.setSshSessionFactory(sshSessionFactory);
                })
                .setCredentialsProvider(new UsernamePasswordCredentialsProvider(username, password))
                .setDirectory(new File(codePath))
                .setBranch(commitId)
                .call();
        checkoutBranch(git, commitId);
        return git;

Other issues

      1. an error is reported when jsch connects to SSH: the invalid private key reports an error in the private key file that uses

--- begin open private key -----

      1. protocol by default. Just use the above method to generate the old RSA private key. In

/etc/SSH/sshd_ Add the following two lines to the config

      1. file to enable SSH to support corresponding algorithms and Macs
KexAlgorithms [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1

MACs [email protected],[email protected],[email protected],[email protected],hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,[email protected],hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-96

Restart sshd service on MAC

sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist

Stop sshd service on MAC

sudo launchctl unload -w /System/Library/LaunchDaemons/ssh.plist

How to check whether a process is started

sudo launchctl list | grep sshd
0   com.openssh.sshd