今天刚看《第一行代码》的最后一章开发天气预报时:用git bash与远程数据库传数据时,
遇到几个问题,虽然解决了,跟大家分享一下,
1,.输入 git add .
提示错误:fatal: Not a git repository (or any of the parent directories): .git
解决办法:
(1)先输入:git init
这时输出:Initialized empty Git repository in f:/Program/MySecondDay/CoolWeather/.git/
(2)再输入:git add .
就会输出:warning: LF will be replaced by CRLF in AndroidManifest.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in proguard-project.txt.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in project.properties.
The file will have its original line endings in your working directory.
就可以了.
2.输入:git push origin master
提示:fatal: 'origin' does not appear to be a git repository
以及fatal: Could not read from remote repository.
解决办法:
输入:git remote add origin git@github.com:djqiang/gitdemo.git
github:代表库名,就是你在google申请的,如我的:maiyu-green
gitdemo:代表项目名,如我的:CoolWeather
3,输入:
git push origin master
出错:error: failed to push some refs to
33.3
本文分享了使用Git Bash与远程数据库传输数据时遇到的三个问题及解决方案:初始化Git仓库、设置远程仓库地址、解决本地未更新到最新版本项目的问题。提供了详细步骤和注意事项。
810

被折叠的 条评论
为什么被折叠?



