Tag Archives: Git error

hint: Updates were rejected because the remote contains work that you do To XXX

his error reported when using webstorm or idea push code

The reason is to manually create git and specify the remote project

Open Terminal

git init # Initialize the local warehouse
git remote -v # View the associated warehouse address
git remote add origin https://gitee.com/xjseo/personnel-management.git # Add remote warehouse address

Then restart the editor and it will appear in the upper right corner

Then click the checkmark commit to submit all the code to the temporary storage,

Then click the third arrow to push

Will be fail to push

Checking the git log will find the following errors:

error: failed to push some refs to 'https://gitee.com/xjseo/personnel-management.git'
hint: Updates were rejected because the remote contains work that you do
To https://gitee.com/xjseo/personnel-management.git
hint: not have locally. This is usually caused by another repository pushing
!    refs/heads/master:refs/heads/master    [rejected] (fetch first)
Done
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.

The general idea is that you should pull the warehouse code and synchronize the local code.

So then click the first one to pull the following and then click the third push to succeed.

git error: The following untracked working tree files would be overwritten by checkout

Git resolves an error: The following untracked working tree files would be overwritten by checkout
December 27, 2017 12:09:50
Reading count: 1,792
When switching branches in IDEA, such an error occurred, resulting in The failure to switch properly: error: The following untracked working tree files would be overwritten by checkout
According to the error message, the problem is caused by some untracked working tree files. So just solving these untracked files solves this problem.
Solutions:
Open SourceTree through the command line, enter the local version warehouse directory, directly executed

git clean -d -fx

Can. Git clean-d-fx means: delete files that don’t have Git add; git clean-fx means: delete files that don’t have Git add.
Git clean parameters
-n displays files and directories to be deleted;
-x – Deleting ignored files is no longer recognized by Git
-D — Deletes files that have not been added to Git’s path
— F — Forced operation
Git clean – n
Git clean – df
Git clean – f

Git commit encountered error: pathspec (Fixed)

 This is the first problem I've encountered as a rookie just learning to use git.
 The problem is that after git clone a repository, it adds two files to it, but when git commits, it says error: pathspec 'add README.txt.........' did not match any file(s) known to git.
 When I looked at the command more closely, I found that I was missing the -m parameter in my git commit, and the error was: git commit 'add README.txt'.
 The error is: git commit 'add README.txt_.....'
 It should read: git commit -m 'add README.txt......'

! [rejected]master -> master error: failed to push some refs to’https://github.com/ The ultimate solution

Git error:

$ git push -u origin master

To [email protected]:***.git

 ! [rejected]        master -> master (non-fast-forward)

error: failed to push some refs to '[email protected]:***.git

hint: Updates were rejected because the tip of your current branch is behin

hint: its remote counterpart. Integrate the remote changes (e.g.

hint: 'git pull ...') before pushing again.

hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Git already has some code in the repository, so it doesn’t allow you to overwrite your code directly. There are two ways to solve this problem:
method 1: force the code to github warehouse (recommended, save time and effort)

git push -f origin master		//直接强推,即利用强覆盖方式用你本地的代码替代github仓库内的内容

method 2: fetch git’s stuff to your local, merge and push

git fetch
git merge			//这两条命令等价于git pull  
git config branch.master.remote origin  
git config branch.master.merge refs/heads/master  

Then pull git back and git pushes your code. Reference: Here.

error: src refspec master does not match any error:failed to push some refs to ‘[email protected]:xxxx

once you have a local repository you need to set up a github repository and have both repositories remotely synchronized, the first time you synchronize your code remotely

occurs

git push-u origin master has problems:

error: src refspec master does not match any
error: failed to push some refs to '[email protected]:xxxxxxxx/xxx.git'

cause:

1. If the readme.md is not checked when the remote warehouse is created: commit to the remote library without any content in the staging area. If the empty staging area cannot be committed, add and commit

are required at least once

2. If the readme.md file on github is not in the local directory

resolved:

if question 1:

git add .

git commit -m “commit all local code to origin”

git push -u origin master

if question 2:

Git pull –rebase origin master

this is where you can see the local readme.md file

and now you can do git push-u origin master

error: RPC failed; curl 56 OpenSSL SSL_ read: SSL_ ERROR_ Syscall, errno 10054 solution

is not guaranteed to solve the problem. Search multiple blogs to try to find a solution. Finally clone succeeded. (PS: don’t guarantee success)
http://www.wangxianfeng.cn/wordpress/2018/07/14/git use the common errors in the process of solving/

https://www.cnblogs.com/emmetyang/p/10620819.html attempts to download ffmpeg source problem: (PS: what is the difference between the snapshot version and the version, welcome to the great god taught)

$ git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
Cloning into 'ffmpeg'...
remote: Counting objects: 570040, done.
remote: Compressing objects: 100% (118805/118805), done.
error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

first is the problem may be upload size limit, execute the following command:

git config http.postBuffer 524288000

clone again may still error, then you can try

git config http.sslVerify "false"

but then it’s

fatal: not in a git directory

according to the second blog post, use the following command

git config  --global   http.sslVerify "false"

// note that the original blog command was written incorrectly. It should be – global

and then

git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg

just wait.