情况:本地项目已经创建好,但是在github上并没有项目。
1、创建项目文件夹,如:E:\test\demo
2、demo目录下有我们已经写好的文件,如:新建文本文档.txt
3、打开命令行,进入到demo目录,执行git init命令初始化目录
4、登录你的github,创建与项目名称一样的项目
5、打开命令行,在项目目录下执行:git pull --rebase 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.
这个错误是因为我们没有将我们本地的项目和github上的项目进行关联。
执行git remote add origin 你的项目地址
如刚才我们新建的项目地址:git remote add origin https://github.com/xishaoguo/demo.git