[英]git failed in Qt creator
我正在使用 gitlab 来管理我的代码。
当我使用 git bash 管理我的代码时,它可以成功提交并将代码推送到服务器。
我在 git bash 中使用的代码是这样的:
git add .
git commit
git push -u origin master
但是,当我在Qt creator中提交项目时,作者信息不会自动填充。
(单击此处获取捕获图像 1 )
更重要的是,我在 Qt creator 中的 git 选项中单击 push。 如:
(点击此处获取截图2 )
它未能将代码发送到服务器,这是错误消息:
14:20 Executing in H:\0000ybzhao\Programming\00.git\pairSam2Bed: C:\Program Files\Git\bin\git.exe 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)
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
The command "C:\Program Files\Git\bin\git.exe" terminated with exit code 128.
有没有人知道为什么会发生这种情况或如何解决这个问题?
提前致谢。
您可能需要使用用户名和电子邮件地址在计算机上初始化git。
https://git-scm.com/book/zh/v2/Getting-Started-First-Time-Git-Setup
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
我将研究Atlassian的SourceTree的安装和使用。 它确实使管理git仓库变得容易和直观。 Windows的另一种简洁工具是p4merge
,可用于在git存储库上进行合并和冲突解决。
在Windows上安装这些工具的最简单方法:
choco install P4Merge SourceTree -y
。 P4Merge
添加为外部合并工具。 希望能有所帮助。
在终端中使用
git push --set-upstream origin master
之后你的Qt会很好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.