今天刚看《第一行代码》的最后一章开发天气预报时:用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
![http://www.crifan.com/files/pic/uploads/2015/02/try-git-pull-rebase-origin-master_thumb.png](http://www.crifan.com/files/pic/uploads/2015/02/try-git-pull-rebase-origin-master_thumb.png)
33.3