简体   繁体   English

Github在Windows上“无法发布此分支”错误

[英]Github “Failed to publish this branch” error on windows

I'm new to git, and I just downloaded it yesterday. 我是git的新手,我昨天刚刚下载了它。 As a test for my first online (not local) repo, I committed a useless text file and then hit publish. 作为我的第一个在线(非本地)仓库的测试,我提交了一个无用的文本文件,然后点击发布。 After a short while, I got this very non-descriptive error: 片刻之后,我得到了这个非描述性的错误:

在此输入图像描述

So I know that I can't publish to this branch. 所以我知道我不能发布到这个分支。 There's only one and it's the master branch. 只有一个,它是主分支。 Does anyone have any further information on what might be causing this error? 有没有人有关于可能导致此错误的更多信息?

As a side note, my partner has successfully uploaded files to the same repo, but I haven't gotten any sort of indication that this has happened. 作为旁注,我的合作伙伴已成功将文件上传到同一个仓库,但我没有得到任何迹象表明这种情况已经发生。 Does this mean I'm not connected to the repo properly in some way? 这是否意味着我没有以某种方式正确连接到回购? I was the one who set it up! 我是那个设置它的人!

In Windows, right click on your repository --> click on open a shell here 在Windows中,右键单击您的repository - >单击open a shell here

You will see a command prompt. 您将看到命令提示符。

type git push in it. 键入git push in it。 (been aware after seeing SimonBoudrias comment) (在看到SimonBoudrias评论后意识到)

The command prompt will suggest you to type some other command or shows an error. 命令提示符将建议您键入其他命令或显示错误。

If the command prompt suggest you to type something else, then type that. 如果命令提示符建议您键入其他内容,则键入该内容。 It will work. 它会工作。
If the command prompt shows error then please post the detailed error here. 如果命令提示符显示错误,请在此处发布详细错误。

Info : You might want to check this app 信息 :您可能想要查看此应用

Open a shell in your repository. 在存储库中打开shell Then type 然后输入

git push --set-upstream origin master --force

This will upload your local repo to the server no matter what, overwriting if necessary. 这会将您的本地仓库上传到服务器,无论如何,必要时overwriting This should only be done if you're sure nobody else is publishing to your repo at the moment. 只有在您确定此刻没有其他人发布到您的仓库时, 才应该这样做

I had the same issue as mentioned here, but none of the solutions mentioned above helped. 我遇到了与此处提到的相同的问题,但上面提到的解决方案都没有帮助。 Then I found this answer which talks about Proxy settings , which is exactly why GitHub was failing to commit on my machine. 然后我找到了这个谈论Proxy settings 答案 ,这正是GitHub无法在我的机器上提交的原因。 Hope this helps somebody else 希望这有助于其他人

To set up your Proxy Settings, you just need to use this command: 要设置代理设置,只需使用以下命令:

git config --global http.proxy http[s]://userName:password@proxyaddress:port git config --global http.proxy http [s]:// userName:password @ proxyaddress:port

Another possibility is a temporary unavailability of GitHub servers . 另一种可能性是GitHub服务器暂时不可用

I'm just having the same problem and confirmed that it's a server issue: https://status.github.com/ 我遇到了同样的问题,并确认这是服务器问题: https//status.github.com/

Sample screenshot: 截图示例:

GitHub暂时失败了

To fix it, open a command prompt in the repo. 要修复它,请在repo中打开命令提示符。 For example by pressing the cog in the top right in the repo view and selecting "open a shell here". 例如,在repo视图中按下右上角的cog并选择“在这里打开shell”。

  • In the command prompt, type git push --set-upstream origin master 在命令提示符下,键入git push --set-upstream origin master

  • Either this will work, or it will say ! [rejected] master -> master (fetch first) 这可能会起作用,或者它会说! [rejected] master -> master (fetch first) ! [rejected] master -> master (fetch first)

  • If this happens, type git pull origin master (add --rebase if you like) 如果发生这种情况,请输入git pull origin master (如果您愿意,可以添加--rebase)

In GitHub the Publish-button might still be visible instead of the sync button. 在GitHub中,发布按钮可能仍然可见,而不是同步按钮。 If this is the case, simply restart GitHub. 如果是这种情况,只需重新启动GitHub即可。

What this does is resetting the default remote branch for your local branch to master. 这样做是将本地分支的默认远程分支重置为主分支。

Maybe you just forget type something to the Description area when you commit your files. 也许您只是在提交文件时忘记在“描述”区域输入内容。 Someone like me only type the summery.So make sure you have fill in the Summary and Description when you commmit. 像我这样的人只输入夏季。所以请确保在提交时填写摘要和说明

Just type something to the Description textarea when commiting. 只需在提交时输入描述textarea。 Then i published successfully. 然后我成功发布了。

what i do? 我所做的? 1 Go to the folder of your repository in Windows Explorer 2 delete the file your want to publish. 1在Windows资源管理器中转到存储库的文件夹2删除要发布的文件。 and recreat it. 并重新审视它。 3 Open GitHub For Windows and click on your Repository .then you will find Uncommitted changes on left side. 3打开GitHub For Windows并单击您的存储库。然后您将在左侧找到未提交的更改。
4 type your Summary 5 type your Description.(the most important step !!!) 6 commit to master 7 Hit Publish and You should be successful. 4键入您的摘要5键入您的描述。(最重要的一步!!!)6提交主7点击发布,你应该成功。

This is my first answer. 这是我的第一个答案。 so i have no 10 reputation to post an image......hope help you. 所以我没有10个声望发布图片......希望能帮到你。

I had this error since I forgot to add remote repository link in the GitHub desktop. 我有这个错误,因为我忘了在GitHub桌面上添加远程存储库链接。 Once added the correct repo link, everything worked. 一旦添加了正确的repo链接,一切正常。

Try to commit your changes before publishing. 尝试在发布之前提交更改。 It helps me to solve same problem. 它帮助我解决同样的问题。

I too had the same problem while publishing my GitHub page. 我在发布GitHub页面时也遇到了同样的问题。 I solved it in the following way. 我用以下方式解决了它。

$git push

I got the error message here. 我在这里收到了错误消息。 Then I made a pull request 然后我做了拉请求

$git pull

After this I made the push again 在此之后我又推了推

$git push

Here I got the solution 我在这里得到了解决方案

Note:I use GitHub for windows,And finally published the page using it 注意:我使用GitHub for windows,最后使用它发布页面

I was getting that error because I hadn't properly configured my name and email. 我收到了这个错误,因为我没有正确配置我的姓名和电子邮件。 On the page where you do that (in the native app, at least), you'll see that the page opens with your name and email already filled in but that doesn't mean that they're saved as settings. 在您执行此操作的页面上(至少在本机应用程序中),您将看到页面打开时已填写您的姓名和电子邮件,但这并不意味着它们已保存为设置。 In order to save them, you have to press the check mark in the bottom left corner of that screen. 为了保存它们,您必须按下该屏幕左下角的复选标记。

I got this error because I already had created a repository with the same name on github, and then created it locally and tried to commit it. 我收到此错误是因为我已经在github上创建了一个具有相同名称的存储库,然后在本地创建并尝试提交它。 The solution was to delete it from github, then commit it from the local client. 解决方案是从github中删除它,然后从本地客户端提交它。 Now they're in sync. 现在他们是同步的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将master合并到github中的Windows分支中? - how to merge master into branch in github for windows? Windows github工具-使用分支取消发布还是删除? - windows github tool - use branch unpublish or delete? TideSDK Windows发布超时错误 - TideSDK Windows publish timeout error 在 GitHub 操作工作流程中,在 Windows Server 2019 上导入代码签名证书失败,并出现“错误:Store::ImportCertObject() failed.”。 - Importing code signing certificate on Windows Server 2019 fails in GitHub Action workflow with `Error: Store::ImportCertObject() failed.` Github无法在Windows 7应用程序上克隆存储库 - Github failed to clone repository on windows 7 application 如何在 Windows 上可视化 GitHub 分支历史记录? - How can I visualize GitHub branch history on Windows? Github在Windows Azure上部署时出错 - Error on Github deploy on windows azure Github Windows:从命令行创建的新分支未显示在 github.com 上 - Github Windows: New branch created from command line not showing up on github.com 如何使用 Windows 命令行在 Web 上打开当前的 GitHub 分支? - How can I open the current GitHub branch on Web using Windows command line? Windows Azure发布失败 - Windows azure publish fails
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM