- 我在 github 上创建了一个新的存储库。
- 我选择了添加 README.md 的选项之一。
- 然后我 cd 进入我硬盘上的项目。
- 我运行了 git init: Initialized empty Git repository in /Users/myusername/github/myproject/.git/
我跑了“git add”。然后是“git commit -m 'project files'”,它的回应是:
[master (root-commit) ca52fe0] project files 981 files changed, 257939 insertions(+), 0 deletions(-) create mode 100644 index.php create mode 100644 license.txt create mode 100644 readme.html create mode 100644 wp-activate.php ...
- 然后我运行“git remote add origin https://github.com/myusername/myproject.git ”
- 然后我跑了“git push origin master”
- 然后我运行“git status”,它没有说什么要提交
但是我查看 repo 并且我的“我的项目文件”提交不存在。于是我跑了 git pull 得到了这个:
You asked me to pull without telling me which branch you
want to merge with, and 'branch.master.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.
然后 git push 并再次检查,我的提交仍然不在 github repo 上。我唯一能看到提交的是当我运行“git log”时:
MacBook-myproject myusername$ git log
commit ca52fe090e6dbf1b6aa6ee51c3283efbe7549904
Author: User <myemailaddress>
Date: Sat Jun 23 19:22:05 2012 -0400
project files
我尽我所能遵循 github 的指示。我究竟做错了什么?