BUG|Git相关

问题1:

$ git pull

fatal: unable to access '×××.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

解决方案1:

export GIT_SSL_NO_VERIFY=1

但是只是临时解决,另一个项目的git操作依旧出现相同bug

解决方案2:

git config --global http.sslverify false


问题2:

生成SSH密钥

1.查看目录:~/.ssh

2.生成ssh-keygen

3. cat ./id_rsa.pub


问题3:

git push

warning: push.default is unset; its implicit value has changed in

Git 2.0 from 'matching' to 'simple'. To squelch this message

and maintain the traditional behavior, use:

git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

git config --global push.default simple

When push.default is set to 'matching', git will push local branches

to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'

behavior, which only pushes the current branch to the corresponding

remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.

(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode

'current' instead of 'simple' if you sometimes use older versions of Git)

error: src refspec master does not match any.

error: failed to push some refs to 'https://3reality.tech/gogs/**/weishu_document.git'

原因:

没有git add


问题3:

 git commit -m "add"

*** Please tell me who you are.

Run

git config --global user.email "[email protected]"

git config --global user.name "Your Name"

to set your account's default identity.

Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got '**@**-Vostro-3667.(none)')

解决方案:

git config --global user.email "**@××.com"

git config --global user.name "**"

问题4:

git push

Username for 'https://3reality.tech': **

Password for 'https://**@3reality.tech':

No refs in common and none specified; doing nothing.

Perhaps you should specify a branch such as 'master'.

Everything up-to-date

原因

这是Git 找不到你要提交的版本了。

解决方案:

git push origin master

Username for 'https://3reality.tech': **

Password for 'https://**@3reality.tech':

Counting objects: 7, done.

Delta compression using up to 4 threads.

Compressing objects: 100% (7/7), done.

Writing objects: 100% (7/7), 4.02 MiB | 7.30 MiB/s, done.

Total 7 (delta 0), reused 0 (delta 0)

To https://3reality.tech/gogs/**/weishu_document.git

* [new branch]      master -> master

问题5:

git pull

Username for 'https://3reality.tech': **

Password for 'https://**@3reality.tech':

remote: Counting objects: 44, done.

remote: Compressing objects: 100% (44/44), done.

error: insufficient permission for adding an object to repository database .git/objects

fatal: failed to write object

fatal: unpack-objects failed

解决方案:

sudo chmod g+w -R .git/objects

你可能感兴趣的:(BUG|Git相关)