Tag Archives: git

Solution of GIT using error: fatal: couldn’t find remote ref master

How is 618 sales champion made?Uncover the secret of e-commerce’s “invigorating” hundreds of millions of sales data>>>

git: fatal: couldn’t find remote ref master

Reference article:

(1) Solution of GIT using error: fatal: couldn’t find remote ref master

(2) https://www.cnblogs.com/tig666666/p/8425865.html

Let’s make a note.

Git Conflict error: Your local changes would be overwritten by merge. Commit, stash or revert them to proceed?

Git Conflict error: Your local changes would be overwritten by merge. Commit, stash or revert them to proceed?

 

How to Solve this error:

 

There are three solutions:

The first type: (Strongly not recommended, to be scolded) Ignore, directly commit your own code.

git commit -m “your msg”

The second: stash (strongly recommended method)

stash translates as “hidden”, as follows:

git stash
git pull
git stash pop
Then diff the file to see the automatic merge and make the necessary changes.

git stash: Back up the content of the current workspace, read the relevant content from the most recent submission, and ensure that the workspace is consistent with the content of the last submission. At the same time, save the current workspace content to the Git stack.
git stash pop: Read the last saved content from the Git stack and restore the relevant content of the workspace. Since there may be multiple Stash contents, they are managed by stacks. Pop will read the contents from the most recent stash and restore it.
git stash list: Display all the backups in the Git stack. You can use this list to determine where to restore.

git stash clear: Clear the Git stack. At this point, using graphical tools such as gitg, you will find that which nodes of the original stash have disappeared.

The third type (strongly not recommended, because you will overwrite what you have written, not recommended) hard coverage: abandon local modifications and directly overwrite the local code with the code on git:

git reset –hard
git pull

Supplement the above operations in idea:

Step 1: Right-click the project name->git->repository-> stash changes and fill in the information to backup

Step 2: Right-click the project name->git->repository->pull

Step 3: Right-click the project name->git->repository->unstash changes

In the third step, your local changes would be overwritten by merge, etc. may appear, because you have modified the files you pulled down before saving locally.

When this happens, click on the view below Your local changes would be overwritten by merge, select one file for one file, and there are three files when you select.

Left, middle and right, the middle is the result file, the left is the large file that was pulled down, and the right is the file that you modified locally. If you want to use the file that was pulled down, select accept left. If you want to save the local modification, select accept right. can

Method 2 stash:

Method 3 Hard Cover:

Commonly used git stash commands:

(1) git stash  save “save message”: When performing storage, add remarks to facilitate searching. Only git stash is also possible, but it is not easy to identify when searching.

(2) git stash list   : check which stores are stored in stash

(3) git stash show  : show what changes have been made, the default show is the first store, if you want to show other stores, add stash@{ $num}, such as the second git stash show stash@{1}

(4) git stash show -p  : Display the changes of the first store. If you want to display other stores, command: git stash show stash@{ $num} -p, such as the second one: git stash show stash@{1 } -p

(5) git stash apply  : apply a certain storage, but will not delete the storage from the storage list. The first storage is used by default, that is, stash@{0}. If you want to use another one, git stash apply stash@{ $ num}, such as the second one: git stash apply stash@{1}

(6) git stash pop  : command to restore the previously cached working directory, delete the corresponding stash in the cache stack, and apply the corresponding modification to the current working directory. The default is the first stash, that is, stash@{0}, If you want to apply and delete other stash, command: git stash pop stash@{ $num}, such as apply and delete the second one: git stash pop stash@{1}

(7) git stash drop  stash@{ $num}: discard stash@{$ num} storage, delete this storage from the list

(8) git stash clear :Delete all cached stash

gitfatal: I don’t handle protocol ‘​https’ [How to Solve]

1. Background notes

Today, GIT clone times fatal: I don’t handle protocol ‘HTTPS’ is used in cygwin as follows:

I thought that there was something wrong with git implemented by cygwin, so I didn’t care too much about it. I replaced it with CMD, but it still reported fatal: I don’t handle protocol ‘HTTPS’

And there is a warning: your console font probably doesn’t support Unicode

Title bar right click attribute, change the font to imitation song, the warning is gone, but still fatal: I don’t handle protocol ‘HTTPS’

There is no way to search for a wave, and then I see a lot of like answers on stackoverflow

Special characters?It’s reasonable that git can’t not support HTTPS, and I don’t have a Chinese link. How can Unicode appear in CMD

Looking back at the link carefully, we finally find the answer: there are two spaces before HTTPS. Two spaces are not the problem, but the problem is that one space is Unicode

2. Treatment method

This kind of error rate is probably caused by special characters before the link, especially before the protocol (such as HTTP and HTTPS)

For example, the error I report here is that there is a Unicode space in front of HTTPS. Just delete it and then execute it

Git Error: nothing to commit, working directory clean [How to Solve]

Local access to remote changes (only access, not merged): git remote update or git fetch origin

Next, git status - uno : allows you to see if the current branch is ahead/behind/diverging from the remote branch it tracks

Or, git show branch * Master : you can see the commits of all the branches whose names end with master, so you can see the differences between origin/master and master on the commits level

Finally, git diff origin/Master : you can see the difference between origin/master and master in code (file) level

Git Conflict Error: commit your changes or stash them before you can merge. [How to Solve]

To update the code with git pull, we encountered the following problems:

error:Yourlocalchangestothefollowingfileswouldbeoverwrittenbymerge :

xxx/xxx/xxx.java

Please,commityourchangesorstashthembeforeyoucanmerge.

Aborting

the tips are very friendly, and the answers from netizens can help me solve the problem directly

1.stash

Usually, if you encounter this problem, you can directly commit your modification; But I don’t want to do that this time

See how git stash does it

git stash
git pull
git stash pop

Next, diff this file to see the situation of automatic merging, and make corresponding changes

Git stash: back up the content of the current workspace, read the relevant content from the latest submission, and make the workspace consistent with the content submitted last time. At the same time, save the current workspace content to git stack
git stash Pop: read the last saved content from git stack to recover the related content of the workspace. Since there may be multiple stash contents, the stack is used to manage them. Pop will read the contents from the latest stash and recover them
git stash list: displays all the backups in Git stack, which can be used to decide where to recover from
git stash clear: clear git stack. At this point, using gitg and other graphical tools, you will find that the original stash nodes have disappeared

2. Abandon local modification and directly cover it

git reset --hard
git pull

[Solved] Git conflict Error: commit your changes or stash them before you can merge

Git conflict: commit your changes or stash them before you can merge

When updating the code with git pull, we encountered the following problems:

error: Your local changes to the following files would be overwritten by merge:
*********************************************************
Please, commit your changes or stash them before you can merge.
Aborting

The reason for this problem is that other people have modified xxx.php and submitted it to the version library, and you have also modified xxx.php locally. At this time, if you do git pull, there will be a conflict. The solution is very clear in the above prompt

1. Retain local modification

1) Direct commit local modification — this method is not generally used

2) Through git stash — usually this way

git stash
git pull
git stash pop

Restore the work area to the last submitted content through git stash, and back up the local changes at the same time. After git pull is completed, execute git stash pop to apply the previous local changes to the current work area

Git stash: back up the content of the current workspace, read the relevant content from the latest submission, and make the workspace consistent with the content submitted last time. At the same time, save the current workspace content to git stack

Git stash Pop: read the last saved content from git stack and recover the related content of workspace. Since there may be multiple stash contents, the stack is used to manage them. Pop will read the contents from the latest stash and recover them

Git stash list: displays all the backups in Git stack. You can use this list to decide where to recover from

Git stash clear: clear git stack. At this point, using gitg and other graphical tools, you will find that the original stash nodes have disappeared

2. Discard the local modification – this method discards the local modification and cannot be retrieved

git reset --hardgit pull< br>& lt; br>& lt; br>& lt; br>& lt; br>& lt; br>

[Solved] Git push origin master fatal: ‘origin’ does not appear to be a git repository fatal…

 

git add *

git status

git commit -m "upload your codes"

git push origin master   
error git push origin master
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

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


git remote add origin [email protected]:names/xiansun-manager-service.git

git push origin master

Git Connect Error: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).

I want to pull remote project to local

E:\files\github\gmdropship>git pull git@ip:username/ship_web.git
git@ip's password:
Permission denied, please try again.
git@ip's password:
Permission denied, please try again.
git@ip's password:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
fatal: Could not read from remote repository.

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

Found repeatedly asked to enter the password, the password is right, but still show no authority. To view the SSH connection log:

E:\files\github\gmdropship>ssh -vT git@ip
OpenSSH_for_Windows_7.6p1, LibreSSL 2.6.4
debug1: Reading configuration data C:\\Users\\Micky/.ssh/config
debug1: Connecting to ip [ip] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\Micky/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\Micky/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\Micky/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\Micky/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\Micky/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\Micky/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\Micky/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\Micky/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_7.6
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4
debug1: match: OpenSSH_7.4 pat OpenSSH* compat 0x04000000
debug1: Authenticating to ip:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:VUmEOh8FW/w2DaxFRH9SCrvIIF5j0dcEpxUy3Z7BtV4
debug1: Host 'ip' is known and matches the ECDSA host key.
debug1: Found key in C:\\Users\\Micky/.ssh/known_hosts:4
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:B8BjflVLnBcR/eD2USLssP40zIZSbdj0o2Dl9aGFuOo C:\\Users\\Micky/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: C:\\Users\\Micky/.ssh/id_dsa
debug1: Trying private key: C:\\Users\\Micky/.ssh/id_ecdsa
debug1: Trying private key: C:\\Users\\Micky/.ssh/id_ed25519
debug1: Next authentication method: password
debug1: read_passphrase: can't open /dev/tty: No such file or directory
git@ip's password:
Connection closed by ip port 22

[solution] find out our public key address through the log C:: <users/Micky \. SSH , and put the public key content on the SSH – keys setting on git platform