我跑了"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
...
Run Code Online (Sandbox Code Playgroud)但我看看回购和我的"我的项目文件"提交不存在.那么我运行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.
Run Code Online (Sandbox Code Playgroud)
然后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
Run Code Online (Sandbox Code Playgroud)
我尽可能地遵循github指示.我究竟做错了什么?
Chr*_*ert 13
在创建了Github存储库之后(即你可以在Github上查看它),那么你应该已经拥有:
git init
touch README
git add README
git commit -m 'first commit'
origin链接到您的存储库的远程:
git remote add origin https://github.com/username/repo.git
git push -u origin master
如果您可以在Github上查看您的存储库,那么它已成功创建.在这种情况下,您可能已经使用在线编辑工具在Github上编辑了README文件,这导致您的远程和本地分支发生分歧.在将本地更改推送到Github之前,您需要获取或拉取远程更改,在本地合并更改(自动合并pull),然后推送到远程.
请参阅Pro Git:从遥控器中取出和拉出
| 归档时间: |
|
| 查看次数: |
49331 次 |
| 最近记录: |