Tag Archives: git

GitHub upload failed: git push error: failed to push some refs to exception handling

reason

When GitHub created the project, the code was uploaded and the readme.md file was manually added to GitHub, but the local warehouse did not update the readme.md file.

resolvent

First, pull the files from the remote code base to the local code base, and then push the new code to the GitHub code base

Use the command to pull: git pull -- rebase origin master
and then upload: git push - U origin master

Github Clone Failed SSL_ERROR_SYSCALL in connection to github.com:443

Problem description

When using git to pull GitHub code, clone failed with the following error

fatal: unable to access 'https://github.com/xxx/xxx.git/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 

Causes

The proxy of HTTPS was set before

resolvent

Cancel the proxy for HTTPS and http

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

Finally, take a look at the global configuration of GIT

git config --global --list

Finally, try git clone . If it fails at the first time, you can re open a terminal for execution

Supplement

Git clone failed fatal: early EOF

This is because git does not have enough cache space. You can try to increase http. Postbuffer (by 500MB)


git config --global http.postBuffer 524288000

error: Your local changes to the following files would be overwritten by merge

The following error occurred when using git pull command today

The result is the above error prompt, translated by Youdao dictionary software, the content is (error: your local changes to the following files will be merged and covered)

Using git log — oneline to check the log, you didn’t get the code. You checked a lot of information and other big men’s blogs on the Internet

The following git instruction method is used   It means to abandon local modification and directly override

1 git reset --hard
2 git pull

[Solved] fatal: could not read Username for

Total: could not read username for ‘http:// solution

After deploying the clone (cicd software), when the commit is triggered, the problem occurs when the clone runner executes the pull warehouse code (on his deployed gogs)

Initialized empty Git repository in /drone/src/.git/
+ git fetch origin +refs/heads/master:
fatal: could not read Username for 'http://ip:port': terminal prompts disabled

The reason is that you need to enter the user name and password, but because this is cicd software, there is no time to enter the password, so there are two solutions:

Using SSH, you can produce git public key on the server where drone is located and upload it to code hosting (I use the gogs built by myself here, but there will also be GitHub, gitea, gitee, gitlab, etc.), so that you don’t need to download and upload the user name and password, and use the memory password mechanism of GIT to save the user name and password

Enter the server where the drone is located, log in with the drone process user, enter the home directory ( Cd ~ ) and execute git clone [your git code path] , and find that you need to enter a password, Ctrl + C interrupt execution touch. Git credentials create. Git credentials file execute vim. Git credentials edit the file, press I key to enter edit mode, enter: HTTP (s):// {your user name}: {your password} @ your git server address [Note: select HTTPS/HTTP, Remove curly brackets] press ESC Enter : WQ save and exit to execute git config -- global credential.helper store cat ~ /. Gitconfig found one more item:

[credential]
helper = store

Explain that it has been configured. Try again git clone [your git code path] no need to enter a password

Fatal: could not read username for ‘http://…’: terminal prompts disabled problem solving~

Git Clone Error: ‘fatal: HTTP request failed‘

There are several possible reasons for this situation

1) Problems with git version

2) The system time is wrong

1) For the first case, use this command to see the GIT version.

git –version

Most of the time, just uninstall the original GIT and re install a newer version. ( https://www.kernel.org/pub/software/scm/git/ perhaps https://github.com/git/git/releases )

2) For the second case, just modify the system time directly.

Use commands to modify, such as:

date -s “25 MAY 2019 17:30:00”

Manual modification is also possible.

Git clone appears fatal: unable to access’ https://github.com/… The solution to the problem

As shown in the figure below, this error occurs when I try to clone someone else’s repo. When I clone from git: /, instead of HTTPS://, it works well.

This happens because the agent is configured in GIT. Since it’s an HTTPS proxy (not HTTP) git config http.proxy And git config — Global http.proxy It doesn’t help.

Solution 1

1. Look at your git configuration

git config –global -l

If you don’t have any content related to the HTTPS proxy, such as HTTPS_ Proxy =… That’s not the problem.

If you have any content related to the HTTPS proxy, please remove it from the ~ /. Gitconfig file and try again.

2. If it still doesn’t work, unset the environment variable

env|grep -i proxy  

You should have one or more lines_ proxy = …

Use the following to cancel settings one by one: cancel settings_ Proxy (or HTTPS)_ Proxy, depending on the name of the variable)

3. Check the environment variables again

env|grep -i proxy  

If it doesn’t show anything, you should be good.

Note: this solution can be applied to HTTP and HTTPS proxy problems. Only the variable name is changed from HTTPS to http.

Solution 2

On the premise of opening shadowlocks, manually configure git agent. Git client can input the following two commands.

git config –global http.proxy http://127.0.0.1 :1080

git config –global https.proxy http://127.0.0.1 :1080

Http:// can also be changed to sockets5://, but the difference is that Socks5 does not support password free login to GitHub through pubkey, and only user name and password can be entered for each code submission. HTTP can support password free login.

Cancel agent:

git config –global –unset http.proxy  

git config –global –unset https.proxy  

In fact, plan 1 and plan 2 are the same method, but plan 2 is more specific. Most problems can be solved by plan 2. When plan 2 is invalid, plan 1 should be considered.

 

reference: https://stackoverflow.com/questions/24543372/git-cannot-clone-or-push-failed-to-connect-connection-refused  

A simple method of generating secret key by GIT and configuring SSH public key

First install git, then right-click in any blank space on the desktop and select git base here, as shown in the following figure:
① mode 1: input command: Cd ~ and then input: SSH- keygen.exe Then press enter, press enter again, and press enter three times at enter:
② mode 2: input: SSH keygen – O – t RSA – B 4096 – C “ [email protected] ”Then press enter, press enter again, at enter, press enter three times (same as mode one)

Then find the ID corresponding to the directory above_ rsa.pub You can open the public key file, open it in Notepad or other ways, copy the contents
, find the settings in your remote warehouse, and configure SSH to succeed
, reprint address (detailed steps address:

https://blog.csdn.net/xiayiye5/article/details/79652296https :// blog.csdn.net/r8hzgemq/article/details/49897905

Push failed Unable to access ‘https://github.com/‘: Failed to connect to github.com port 443: Timed

Remote push error to GitHub warehouse:

Push failed Unable to access ‘ https://github.com/ ‘: Failed to connect to github.com port 443: Timed out

terms of settlement:

Find the GitHub login Certificate in the certificate manager of the control panel and modify the account password.

You can also open it quickly through the CMD window, enter: rundll32.exe keymgr.dll ,KRShowKeyMgr

Error in upload code of tortoisegit error:1407742E

report errors

When I come back from the festival, I type a code to upload it to GitHub and report an error. Whether it’s idea or tortoise, I report the following error:

fatal: unable to access 'https://github.com error:1407742E :ssl routines:ssl23_get_server_hello:tlsv1 alert protocol version

Baidu is also less than Baidu. Just a few days ago, I saw that the software manager suggested that tortoise git should be updated, so I gave it a try and gave it an update (after the update, I prompted that git bash should be updated again), and the result was solved.

solve

My updated software is the following version
tortoise git-preview-2.5.7.0-20180127-b2d00f8-64 bit.msi And git-2.16.2-64- bit.exe .
The link address is:
0 https://github.com/git-for-windows/git/releases/download/v2.16.2.windows.1/Git-2.16.2-64-bit.exe
https://download.tortoisegit.org/tgit/2.6.0.0/
(tortoise Git is updated from the software manager, with the download address of the official website attached. It should also be feasible in theory.)

If the icon of tortoisegit is not displayed after installation, you can refer to this
section https://jingyan.baidu.com/article/359911f552827957fe0306f8.html

Error: invalid permission for adding an object to repository database

➜  atd git:(b4.232) ✗ git pull
remote: Counting objects: 78, done.
remote: Compressing objects: 100% (77/77), done.
remote: Total 78 (delta 60), reused 0 (delta 0)
error: insufficient permission for adding an object to repository database .git/objects
fatal: failed to write object
fatal: unpack-objects failed

Git error

insufficient permission for adding an object to repository database 

Because the. Git directory of the project has the permission of root,

The solution is to switch to the root super administrator and modify the user of the file as the current computer user

chown -R xxxx: .git