git提交改动

原文链接:
http://blog.rexzhao.com/2011/11/28/google-code-git-everything-up-to-date-when-push.html
第一次在 Google Code 上弄项目,注册完毕后,
尝试增加一个新文件用以测试 Git 是否好好工作。
结果在 Push 时却显示 Every up-to-date,检查文件时却发现实际上一个都没更新上去。

因为对 Git 不够熟悉,因此只好 Googling,进行一番搜索后找到原因如下:

Why does Git refuse to push, saying “everything up to date”?
git push with no additional arguments only pushes branches that exist in the remote already. 
If the remote repository is empty, nothing will be pushed. 
In this case, explicitly specify a branch to push, e.g. git push master.

也就是说一开始 git 服务器仓库是完全空的,
不包含任何一个分支(branch),因此刚开始 Push 时需要指定一个。
执行 git remote -v 后看到自己的 remote 端名字为 origin:

$ git remote -v
origin  https://code.google.com/p/micolog2 (fetch) 
origin  https://code.google.com/p/micolog2 (push)

执行 git branch 后看到自己当下用的分支是 master:

$ git branch 
* master

因此在本地 commit 后,再执行 git push origin master 即可。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值