在使用Google Code作为远程仓库时,使用Git push命令没有任何作用。

3
我在Google Code上有一个git项目。https://code.google.com/p/jawabot/

我已经向"master"分支提交了一些内容。它们很好,在git log中也可见。 现在,当我执行git push时,出现了"

的错误信息。
$ git push
Password: 
Everything up-to-date

有时候:
$ git push
Password: 
error: The requested URL returned error: 403 while accessing    https://dynawest@code.google.com/p/jawabot//info/refs

fatal: HTTP request failed

更新:

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

我有什么问题吗?是我还是Google的问题?(我是Git新手。)
如果有人能这样做并试图推送一些内容,我会很高兴的(我认为我将能够恢复这样的更改)。
更新:
根据答案,我尝试了(猜测 git://url):
$ git remote add gc git@code.google.com:jawabot/jawabot.git
$ git remote -v
gc      git@code.google.com:jawabot/jawabot.git (fetch)
gc      git@code.google.com:jawabot/jawabot.git (push)
origin  https://dynawest@code.google.com/p/jawabot/ (fetch)
origin  https://dynawest@code.google.com/p/jawabot/ (push)
ondra@ondra-doma:/mnt/ssd1/_projekty/JawaBot-2.0-git$ git push gc

ssh: connect to host code.google.com port 22: Connection timed out
fatal: The remote end hung up unexpectedly

我不知道为什么会有人放置-1。 - Ondra Žižka
4个回答

6
你需要完成以下步骤。你是否忘记了第一步?
git add <files>
git commit -m 'message'
git push origin master 

不好意思,就像我之前说的一样,提交记录在 git log 中。 - Ondra Žižka
1
最后结果证明我忘记了第三步的一部分 :) - Ondra Žižka
第一次发生时,每个人都会摸索 :) - Anil Shanbhag

6
您要做的事情已经在常见问题解答中得到了回答:http://code.google.com/p/support/wiki/GitFAQ 其中包括为什么只用git push无法工作,以及支持https而不是其他协议。
引用如下: 为什么Git拒绝推送并显示“一切都是最新的”? 使用git push命令时,如果没有其他参数,它只会推送已经存在于远程的分支。如果远程存储库为空,则不会推送任何内容。在这种情况下,请明确指定要推送的分支,例如git push master我可以访问我的存储库,而不是使用https://使用git://或ssh://吗? 为了利用Google生产服务器的高级可扩展性和负载平衡功能,我们只能接受传入的HTTP连接。我们没有计划支持除Git智能HTTP协议(v1.6.6中引入)之外的其他协议。
我们支持通过HTTPS进行匿名(只读)和身份验证(读/写)访问。

1
已解决 - 缺少了分支规范...
$ git push origin master
Password: 
Counting objects: 3724, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2762/2762), done.
Writing objects: 100% (3724/3724), 1.21 MiB | 136 KiB/s, done.
Total 3724 (delta 1669), reused 0 (delta 0)
remote: Scanning pack: 100% (3724/3724), done.
remote: Storing objects: 100% (3724/3724), done.
remote: Processing commits: 100% (196/196), done.
To https://dynawest@code.google.com/p/jawabot/
 * [new branch]      master -> master
ondra@ondra-doma:/mnt/ssd1/_projekty/JawaBot-2.0-git$ 

0
可能你想尝试的是,不使用https地址,而是使用git协议,例如git://git.foo。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接