github 用git bash上传项目 最后提示 Everything up-to-date 但没传上去
发布于 18天前 作者 pangguoming 93 次浏览 来自 问答

如题 求解决办法,下面是 我输入的命令

pangg_000@RAINBOWPANG-PC /d/gitprojects/instagrambot (master) $ git push origin master Username for 'https://github.com’: pangguoming Password for 'https://[email protected]’: Everything up-to-date

5 回复

我用 git status 显示是有东西的,好奇怪: $ git status On branch master Changes to be committed: (use “git reset HEAD <file>…” to unstage)

    new file:   InstagramBotWinform/Instagram3.sln
    new file:   InstagramBotWinform/Instagram3.suo
    new file:   InstagramBotWinform/Instagram3.v12.suo
    new file:   InstagramBotWinform/InstagramBotWinform/Config.Designer.cs
    new file:   InstagramBotWinform/InstagramBotWinform/Config.cs
    new file:   InstagramBotWinform/InstagramBotWinform/Config.resx
    new file:   InstagramBotWinform/InstagramBotWinform/Instagram/IMethod.cs

    new file:   InstagramBotWinform/InstagramBotWinform/Instagram/Instagram.

cs new file: InstagramBotWinform/InstagramBotWinform/Instagram/JSON.cs new file: InstagramBotWinform/InstagramBotWinform/Instagram/ThreadWork .cs new file: InstagramBotWinform/InstagramBotWinform/Instagram/UtfTransfe r.cs new file: InstagramBotWinform/InstagramBotWinform/Instagram/XMLHelper. cs new file: InstagramBotWinform/InstagramBotWinform/InstagramBotWinform. csproj new file: InstagramBotWinform/InstagramBotWinform/InstagramBotWinform. csproj.user new file: InstagramBotWinform/InstagramBotWinform/Login.Designer.cs new file: InstagramBotWinform/InstagramBotWinform/Login.cs new file: InstagramBotWinform/InstagramBotWinform/Login.resx new file: InstagramBotWinform/InstagramBotWinform/LoginWF.Designer.cs new file: InstagramBotWinform/InstagramBotWinform/LoginWF.cs new file: InstagramBotWinform/InstagramBotWinform/LoginWF.resx new file: InstagramBotWinform/InstagramBotWinform/MainWF.Designer.cs new file: InstagramBotWinform/InstagramBotWinform/MainWF.cs new file: InstagramBotWinform/InstagramBotWinform/MainWF.resx new file: InstagramBotWinform/InstagramBotWinform/Program.cs new file: InstagramBotWinform/InstagramBotWinform/Properties/AssemblyI nfo.cs new file: InstagramBotWinform/InstagramBotWinform/Properties/Resources .Designer.cs new file: InstagramBotWinform/InstagramBotWinform/Properties/Resources .resx new file: InstagramBotWinform/InstagramBotWinform/Properties/Settings. Designer.cs new file: InstagramBotWinform/InstagramBotWinform/Properties/Settings. settings new file: InstagramBotWinform/InstagramBotWinform/Resources/banner.png

    new file:   InstagramBotWinform/InstagramBotWinform/Resources/instagram-

icon_128.png new file: InstagramBotWinform/InstagramBotWinform/Resources/loading45. gif new file: InstagramBotWinform/InstagramBotWinform/Setting.Designer.cs new file: InstagramBotWinform/InstagramBotWinform/Setting.cs new file: InstagramBotWinform/InstagramBotWinform/Setting.resx new file: InstagramBotWinform/InstagramBotWinform/bin/Debug.rar new file: InstagramBotWinform/InstagramBotWinform/bin/Debug/InstagramB otWinform.exe new file: InstagramBotWinform/InstagramBotWinform/bin/Debug/InstagramB otWinform.pdb new file: InstagramBotWinform/InstagramBotWinform/bin/Debug/InstagramB otWinform.vshost.exe new file: InstagramBotWinform/InstagramBotWinform/bin/Debug/InstagramB otWinform.vshost.exe.manifest new file: InstagramBotWinform/InstagramBotWinform/bin/Debug/Report.txt

    new file:   InstagramBotWinform/InstagramBotWinform/bin/Debug/XmlRecorde

r/1090090524.xml new file: InstagramBotWinform/InstagramBotWinform/bin/Debug/XmlRecorde r/1116638597.xml new file: InstagramBotWinform/InstagramBotWinform/bin/Debug/XmlRecorde r/1154814038.xml new file: InstagramBotWinform/InstagramBotWinform/bin/Debug/XmlRecorde r/1188419294.xml new file: InstagramBotWinform/InstagramBotWinform/bin/Debug/XmlRecorde r/1195158864.xml new file: InstagramBotWinform/InstagramBotWinform/bin/Debug/XmlRecorde r/1254219500.xml new file: InstagramBotWinform/InstagramBotWinform/bin/Debug/XmlRecorde r/1281923846.xml new file: InstagramBotWinform/InstagramBotWinform/bin/Debug/XmlRecorde r/1388736685.xml new file: InstagramBotWinform/InstagramBotWinform/bin/Debug/XmlRecorde r/1393098141.xml new file: InstagramBotWinform/InstagramBotWinform/bin/Debug/XmlRecorde r/224539589.xml new file: InstagramBotWinform/InstagramBotWinform/bin/Debug/XmlRecorde r/260294229.xml new file: InstagramBotWinform/InstagramBotWinform/bin/Debug/XmlRecorde r/260294229_temp.xml new file: InstagramBotWinform/InstagramBotWinform/bin/Debug/XmlRecorde r/260294229follwedback.xml new file: InstagramBotWinform/InstagramBotWinform/bin/Debug/XmlRecorde r/263879774.xml new file: InstagramBotWinform/InstagramBotWinform/bin/Debug/XmlRecorde r/31000018.xml new file: InstagramBotWinform/InstagramBotWinform/bin/Debug/XmlRecorde r/356608246.xml new file: InstagramBotWinform/InstagramBotWinform/bin/Debug/XmlRecorde r/583748122.xml new file: InstagramBotWinform/InstagramBotWinform/bin/Debug/XmlRecorde r/759145016.xml new file: InstagramBotWinform/InstagramBotWinform/bin/Debug/XmlRecorde r/796515277.xml new file: InstagramBotWinform/InstagramBotWinform/bin/Debug/XmlRecorde r/999698246.xml new file: InstagramBotWinform/InstagramBotWinform/bin/Debug/XmlRecorde r/999698246follwedback.xml new file: InstagramBotWinform/InstagramBotWinform/bitbug_favicon.ico new file: InstagramBotWinform/InstagramBotWinform/obj/x86/Debug/Design TimeResolveAssemblyReferences.cache new file: InstagramBotWinform/InstagramBotWinform/obj/x86/Debug/Design TimeResolveAssemblyReferencesInput.cache new file: InstagramBotWinform/InstagramBotWinform/obj/x86/Debug/Genera teResource.read.1.tlog new file: InstagramBotWinform/InstagramBotWinform/obj/x86/Debug/Genera teResource.write.1.tlog new file: InstagramBotWinform/InstagramBotWinform/obj/x86/Debug/Instag ramBotWinform.Config.resources new file: InstagramBotWinform/InstagramBotWinform/obj/x86/Debug/Instag ramBotWinform.Login.resources new file: InstagramBotWinform/InstagramBotWinform/obj/x86/Debug/Instag ramBotWinform.MainWF.resources new file: InstagramBotWinform/InstagramBotWinform/obj/x86/Debug/Instag ramBotWinform.Properties.Resources.resources new file: InstagramBotWinform/InstagramBotWinform/obj/x86/Debug/Instag ramBotWinform.Setting.resources new file: InstagramBotWinform/InstagramBotWinform/obj/x86/Debug/Instag ramBotWinform.csproj.FileListAbsolute.txt new file: InstagramBotWinform/InstagramBotWinform/obj/x86/Debug/Instag ramBotWinform.csproj.GenerateResource.Cache new file: InstagramBotWinform/InstagramBotWinform/obj/x86/Debug/Instag ramBotWinform.csprojResolveAssemblyReference.cache new file: InstagramBotWinform/InstagramBotWinform/obj/x86/Debug/Instag ramBotWinform.exe new file: InstagramBotWinform/InstagramBotWinform/obj/x86/Debug/Instag ramBotWinform.pdb new file: InstagramBotWinform/InstagramBotWinform/obj/x86/Debug/Resolv eAssemblyReference.cache new file: InstagramBotWinform/InstagramBotWinform/obj/x86/Debug/TempPE /Properties.Resources.Designer.cs.dll new file: InstagramBotWinform/InstagramBotWinform/obj/x86/Debug/Twitte rBotWinform.csproj.FileListAbsolute.txt

你这不是没 commit

自己找到原因了: 第一次在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

即可。

@William17 是的,你说的对。

回到顶部