Google code: Why 'Everything up-to-date' when pushing (git)

, 本文介绍了解决在初次使用Git向Google Code仓库推送代码时遇到的Everything up-to-date问题的方法。通常这发生在远程仓库为空的情况下,文章详细说明了如何通过指定分支来完成首次推送。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

原文链接: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

即可。



评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值