Tag Archives: git

git error:invalid path [How to Solve]

Pull handover branch code and error found git error: invalid path xxx or error: unable to create file

    1. git status Look at the code that needs to be processed
    2. git reset –hard To a previous stable version
    3. git clean -df Clear uncommitted files

The file that caused the error was found in the git history

  1. error: unable to create file keycloak-10.0.2/F:\workspace\electric\sedt-webfront\keycloak-10.0.2\standalone\log\server.log: Invalid argument
  2. Who submits the file and who deletes the file
  3. git pull Re-pull the file

Reason: There is a difference between the file path created by Mac and Windows, which causes the file path created cannot be generated in Windows. Delete the file to solve the problem

[Solved] Ubuntu Error: Failed to connect to 127.0.0.1 port xxxxx: Connection refused

Method 1

Check the agent

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

Cancel if you have one, or change another method if you don’t

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

Method 2

Check whether the system environment uses agents

env|grep -I proxy

The following similar configuration appears

If there is a corresponding agent, cancel it

unset http_proxy
unset https_proxy

Method 3

Manually operate the Ubuntu agent and cancel the agent in the settings.

[Solved] Git push error: error: RPC failed; HTTP 413 curl 22 the requested URL returned error: 413

 

#Accident scene

Git submitted push with enrollment error:

Enumerating objects: 448, done.
Delta compression using up to 4 threads
Total 424 (delta 109), reused 0 (delta 0), pack-reused 0
POST git-receive-pack (433422517 bytes)
Error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413

#Solution

As can be seen from the above error message, the code size submitted by Git is 433422517 bytes, about 400m; It is suspected that the submitted documents are too large.

1. First, modify the GIT global configuration

git config –global http.postBuffer 524288000

The result is pushed again, which is invalid
it is suspected that the size of the transfer file is limited in other places. In retrospect, the server where Git is located was accessed directly, but later it was accessed after being forwarded by Nginx. Therefore, I think there may be a problem with the Nginx configuration.

2. View git related configuration of Nginx

	location ~ /git(/.*) {
	    # others
	    
	    client_max_body_size 200M;
	}

The client_max_body_Size modify the configuration to 500m and restart Nginx
push again to solve the problem.

Git push Failed to connect to localhost port 1080 [How to Solve]

Conclusion: it is caused by setting agent

1. Check the global settings

Enter git config -- Global - e to check whether there are proxy settings for [HTTP] and [HTTPS] in the global configuration, such as proxy= socks://localhost:1080, if any, delete it.

2. Check the config in the current. Git file

In the current working directory, cat ./.Git/config

As shown in the figure above, delete the agent.

Gt Report Error ssh:connect to host github.com port 22

kex_exchange_identification: Connection closed by remote host
Connection closed by 140.82.121.3 port 22
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

  It is suddenly found that git cannot operate, and an error is reported, as shown in the figure above.

Thought the SSH key failed?Check it. It’s corresponding.

Testing

$   ssh -T   [email protected]

The result is still  

Internet search method:

Test port 443 can be successful  

$ ssh -T -p 443 [email protected]

Referring to the online method, the solution is as follows:

  Locate git’s config file  /etc/ssh/ssh_ Config and edit

$   vi /etc/ssh/ssh_ config     

If you don’t have permission, use sudo

Add the following code at the end and save

Host github.com
User git
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443

success!  

Then you can operate git normally!

Git pull code error fatal: authentication failed fo

Git pull code error fatal: authentication failed fo

Detailed error reporting information:

git.exe pull --progress -v --no-rebase 
"http://nj.eliansun.com:8082/tfs/DefaultCollection/
%E6%B1%9F%E8%8B%8F%E5%8C%BB%E4%B
F%9D%E9%A1%B9%E7%9B%AE/_git/01_%E6%B
1%9F%E8%8B%8F%E5%8C%BB%E4%BF%9D%E
5%9B%BD%E5%AE%B6%E6%96%B0%E5%B9%B3%E5%8F%B0" zj_demo
fatal: Authentication failed for 'http://nj.eliansun.com:8082/tfs/DefaultCollection/%E6%B1%9F%E
8%8B%8F%E5%8C%
BB%E4%BF%9D%E9%A1%B9%E7%9B%AE/_git/01_%
E6%B1%9F%E8%8B%8F%E5%8C%BB%E4%BF%9D
%E5%9B%BD%E5%AE%B6%E6%96%B0%E5%B9%B3%E5%8F%B0/'

The general description is that your voucher is wrong. If you have changed your password recently, you need to modify your local voucher as follows:

Open control panel in --- user account --- credentials management --- windows credentials --- edit --- save

If the account and password are correct (not in accordance with the above), please look below

First kind

Use the command to re-enter the account password

git config --system --unset credential.helper

Errors, i.e. permission problems, may occur, for example:

error: could not lock config file C:/Program Files/Git/mingw64/etc/gitconfig: Permission denied

The file C:/program files/git/mingw64/etc has insufficient permissions. Change the operation permissions under this folder to all permissions. Windows 10 system can be set to everyone, and then re execute the above commands.

Second

If the above operation cannot modify the permission or the above operation is still invalid, you can use the tool [tortoisegit] for short, little turtle

The specific operations are as follows:
enter the little turtle setting page

double click git, select Edit gitconfig (y) to enter the page, and then modify the following position

Amend as follows

[credential]
	helper = store

After pulling or other operations, you will be prompted to enter the account password before operation

[Solved] Git error: inflate: data stream error (invalid block type) error: corrupt loose object

Error reported when using git push
error: Insert: data stream error (invalid block type)
error: corrupt loose object ‘c8b7f5f344dbfe7d5b7339b977873c21f71478aa’

I tried many methods. Finally, I cleared the local git, fetched it and pushed it again:

rm -rf .git # Delete the local git repository
# Resume local git repository
git init 
git remote add origin Your repository link
git fetch # git pull = git fetch + git merge
git reset --hard origin/master 
git branch --set-upstream-to=origin/master master  

[Solved] Git push Warning: error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413

1. Error Messages:

execute git push http://git.xxx.com/app/guanghe-app.git –all reward

Error Messages:
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
Everything up-to-date

The above problem is caused by the size limitation of HTTP push files. Just submit them in SSH.

2. Upload via SSH

git push ssh://git @10.1.8.121:1122/app/guanghe-app.git –all

Enumerating objects: 15951, done.
Counting objects: 100% (15951/15951), done.
Delta compression using up to 6 threads
Compressing objects: 100% (2863/2863), done.
Writing objects: 100% (15951/15951), 35.04 MiB | 23.89 MiB/s, done.
Total 15951 (delta 12568), reused 15905 (delta 12533)
remote: Resolving deltas: 100% (12568/12568), done.
To ssh://10.1.8.151:1122/app/guanghe-app.git
 * [new branch]      dev -> dev

The warehouse has been uploaded successfully

[Solved] Springcloud config Error: Error occured cloning to base directory.

An error occurred when springcloud config obtained the remote configuration file
error source code: 2021-11-03 19:51:31.421 warn 6608 – [on (3) – 127.0.0.1]. C.s.e.multiplejgitenvironmentrepository: error occurred cloning to base directory

org.eclipse.jgit.api.errors.TransportException: https://github.com/ClowLAY/spring-cloud-config.git: Cannot open git upload pack

error reason: the project cannot be cloned because the remote GitHub warehouse cannot be connected
solution: modify the configuration file application.properties

#previous code
spring.cloud.config.server.git.uri=https://github.com/ClowLAY/spring-cloud-config.git

#Modified Code
[email protected]:ClowLAY/spring-cloud-config.git

Successfully obtained the remote warehouse configuration file

Note: change the proxy mode from HTTPS to git
remember to change the remote warehouse address to your own remote warehouse address

Git Push Error: Proxy CONNECT aborted [How to Solve]

Git push origin XXX error proxy connect aborted

Let’s first analyze the problem. The error prompt is obvious. The proxy connection is aborted. What causes it
at the beginning, without saying a word, baidu directly. After various operations, cancel the agent, set the agent, cancel again, and try again?It’s useless. It still reports an error, but the initial timeout error has become proxy connect aborted
it’s hard for me. I’ve been working all day. When it’s time to submit, give me the whole deal?Is this the law that problems must happen before work. Hey, I can’t continue the whole process. I’ve seen various methods on the Internet. The original solution is as follows:

It turns out that there is no separate proxy configured for GIT. Configure proxy for git:
git config — global http.proxy‘ http://127.0.0.1:1087 ’
git config –global https.proxy ‘ socks://127.0.0.1:1080 ’

However, I’m sorry, it’s no use. It’s still wrong. But this operation reminds me that I haven’t checked the GIT configuration of my own project.

Solution:

Next is the moment to witness miracles

    1. first open the file where your project is located.

    1. of course, if you can’t see it after opening the project, don’t panic. Open the folder where your project is located, and then click the view – Show – hide project above. Of course, this is win11. The old version is almost the same.

      1. then let’s go to the. Git folder, open the config configuration file, delete the proxy address, push again, and finish the work.