Tag Archives: Git push Error

Git Push Error: rejected error: failed to push some refs to… [How to Solve]

After the git repository is built, if the repository has md files, you need to pull once first
1. The error message is as follows
The most similar command is
credential-store
To https://gitee.com/martin-sun/web-ui-test-excel-driver.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to ‘https://gitee.com/martin-sun/web-ui-test-excel-driver.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.
2. excute pull
git pull --rebase origin master
3. Push local files
git push -u origin master

Git push error![rejected] master -> master(non-fast-forward) error:failed to push some refs to…

 

A project is created locally and a warehouse is created on GitHub. To link the local warehouse to the remote warehouse, I use the following method:
git init   initialize the local warehouse
git remote add origin XXX add the remote warehouse address
if you execute
git add – a after that,
Git commit – M ”
git push origin master, then this problem will appear (rejected), so after remote add, don’t worry about git add, be sure to git pull origin master, the reason for this is that you have readme files in the warehouse created by code cloud, but not locally, which causes local and remote out of sync,

Then there are two solutions:
Method 1:
if there is no local readme file, a local readme file will be generated

Git pull — rebase origin master local generation of readme files
git push origin master

Method 2:
then I will force the upload to cover the remote file,
git push – f origin master

[Solved] Git push Error: ! [remote rejected] master -> master (pre-receive hook declined)

Git push solution:[ remote rejected] master -> master (pre-receive hook declined)

The day before yesterday, I was going to back out a version and push it to the remote branch, but I tried many times and couldn’t upload it. The error is as follows:

! [ remote rejected] master -> master (pre-receive hook declined)

Screenshot:

1. Turn off the protected permission of the branch where the content to be pushed is located

(1) Enter the settings of your project

(2) Click protected branches and unprotected to change the authority of the master branch, that is, to turn off the protected authority of the master

2. Create a new branch, push the project to the new branch, and merge later

(1) New branch

git branch name

(2) Switch branches

git checkout name

(3) Upload project

git add .

git commit -m "commit message"

git remote add origin remote repository address git push -u origin branch name

[Solved] Git push error. ! [rejected] master -> master (non-fast-forward)

Error prompt:

Cheetah@xxxx MINGW64 /e/Projs/enft/data/cv_key_frame (master)
$ git push
To github.com:AnthonyGIS/video_frame.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:AnthonyGIS/video_frame.git'
hint: Updates were rejected because the tip of your current branch is behind
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.

Cheetah@xxxx MINGW64 /e/Projs/enft/data/cv_key_frame (master)

The reason for the non fast forward problem is that there is already some code in Git repository, so it does not allow you to directly cover your code

method 1

Push, that is, use strong coverage to replace the content in Git warehouse with your local code

If the remote warehouse is just built and there is no code, or you are sure that the code in the remote warehouse is useless, you can operate in this way and try to avoid this operation method

git push -f

Method 2

First fetch git to your local area, then merge and then push

$ git fetch
$ git merge

If, when git merge occurs

fatal: refusing to merge unrelated histories

You can use, git pull origin master –allow-unrelated-histories, to take care of that.

Continue with git merge

If, in case of.

fatal: You have not concluded your merge (MERGE_HEAD exists).
Please, commit your changes before you merge.

is that we haven’t committed the current changes, git add . , git commit -am “commit message”, then git merge again, and ok.

Finally, git push.(git push origin master).

It prompts Already up-to-date, and the upload is done.

git push error: RPC failed; HTTP 403 curl 22 The requested URL returned error: 403

Record a git push error solution, rarely encountered, but forget how to solve it…

error: RPC failed; HTTP 403 curl 22 The requested URL returned error: 403

reason:

        There is only one reason I have encountered here, that is, the password of GIT account is set to be remembered permanently, and then this problem is easy to occur when switching users, because the account password has changed

Solution:

        Modify git configuration file   . git/config   As shown in the figure:

        vim .git/config

        Add the URL to the   // After adding your user name and @ character;

        When submitting again, the account password input box will pop up. After input, you can operate normally

AS Pycharm Git push Error: Invocation failed Server returned invalid Response, Authentication failed

Contents of articles

Android studio git error reporting and Solutions

Pcharm git push error and solution push failed: unable to access’ https://github.com/BierOne/bottom-up-attention-vqa.git/ ‘: Could not resolve host: github.comPush failed Invocation failed Server returned invalid Response. Authentication failed for

Reference link

Android studio git error reporting and Solutions

after all, Android studio and pychar are the same family. However, there are many solutions to as found on the Internet. Here is a brief introduction</ mark>

Invocation failed Unexpected Response from Server: Unauthorized

resolvent:

AndroidStudio -> Preferences -> Git -> SSH Executable and changed from Native to Built-in and it started working.

Reason: SSH key pair protects the password. If you select native SSH executable, the as will not prompt you to enter the password, so the final authentication will fail. However, if build in is set, you will be prompted to enter the password, so the authentication is successful.

Pychar git push error report and solution

Push failed: Unable to access ‘ https://github.com/BierOne/bottom-up-attention-vqa.git/ ’: Could not resolve host: github.com

Solutions and reasons:

This error is obviously caused by network problems. It is recommended to connect to the network again. Generally, the avatar can be displayed normally at this position, that is, there is no problem with the network

Push failed Invocation failed Server returned invalid Response. Authentication failed for

Solution and reason: because there is no build in option in my pychar, the as method is not applicable. My solution is to check “use confidential helper” in the GIT column, which is the authentication assistant:

in this way, you will be prompted to enter your password during authentication, and you can pass the authentication normally. There are other solutions, but they are similar.

In addition, you can also try to use token when adding GitHub account. It should be done once and for all

In the settings page of the GitHub official website account, select create new token, and then copy it