Home git Git doesn't want to push?

Git doesn’t want to push?

Author

Date

Category

What’s wrong, tell me?

[git status ]

REAL @ BENTLY /c/LS/sites/home/test.loc/www/gallery (master)
$ git status
# On branch master
#
# Initial commit
#
# Untracked files:
# (use "git add & lt; file & gt; ..." to include in what will be committed)
#
# .hg /
# .hgignore
# README.md
# css /
# index.html
# js /
nothing added to commit but untracked files present (use "git add" to track)

[git add. ]

REAL @ BENTLY /c/LS/sites/home/test.loc/www/gallery (master)
$ git add.
fatal: LF would be replaced by CRLF in .hg / cache / branchheads

[git remote rm origin ]

REAL @ BENTLY /c/ls/sites/home/test.loc/www/jquery-gallery (master)
$ git remote rm origin
REAL @ BENTLY /c/ls/sites/home/test.loc/www/jquery-gallery (master)
$ git remote add origin [email protected]: nickname / jquery-gallery.git
REAL @ BENTLY /c/ls/sites/home/test.loc/www/jquery-gallery (master)
$ git push -u origin master
The authenticity of host 'bitbucket.org (206.223.241.182)' can't be established.
RSA key fingerprint is 97: 8c: 1b: f2: 6f: 14: 6b: 5c: 3b: ec: aa: 46: 46: 74: 7c: 40.
Are you sure you want to continue connecting (yes / no)? yes
Warning: Permanently added 'bitbucket.org, 206.223.241.182' (RSA) to the list of
known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

p.s. ip changed.

[updated ]

Moved the sources to another directory:

REAL @ BENTLY / c / localgit / jquery-gallery (master)
$ git push -u origin master
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

[Solution ]

Probably more for myself than for someone I will leave a note.

In general, the matter was in public key , I introduced another public key , which is in the file


Answer 1, authority 100%

Probably no refspec for the master branch has been created in your local repository. the repository is empty. Run git status. As a result, you should get a response like this:

# On branch master
nothing to commit (working directory clean)

Answer 2, authority 50%

I also had such garbage when I tried to use the path via https. Perhaps this shit happens if the repository is private and git does not use your ssh keys.

Delete the old origin and add a new one with a different urla:

git remote rm origin
git remote add origin [email protected]: nickname / jquery-gallery.git

Answer 3

I had the same error.
I solved it when I added the command “git branch -M main” before pushing

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions