[英]Visual Studio to GitHub
I want to put my code on a Git repo
via Visual Studio, 我想通过Visual Studio将代码放在
Git repo
,
This documentation says, rightclick on the master branch and press New local branch from.. but I do not have a master branch and the button is disabled in my case: 该文档说,右键单击master分支,然后按from的New local branch。。但是我没有master分支,因此在我的情况下该按钮被禁用:
What am I doing wrong? 我究竟做错了什么?
One possible explanation is that you have created locally a Git repo, but have not created yet at least one commit. 一种可能的解释是您在本地创建了一个Git存储库,但尚未创建至少一个提交。
Make sure you have added/committed your current modification in your local Git repo, and check again if the Visual Studio GUI is still displaying that option as disabled or enabled. 确保已在本地Git存储库中添加/提交了当前修改,并再次检查Visual Studio GUI是否仍将该选项显示为禁用或启用。
Alright it seem's like I really had to create the master branch
by myself first. 好吧,好像我真的必须首先自己创建
master branch
。 I thought this would be added when creating the repo: 我认为在创建存储库时会添加以下内容:
I did the following: Open the command line via right click on the Repo in Visual Studio 我执行了以下操作:通过右键单击Visual Studio中的Repo打开命令行
Type in: git commit -m "Initial Commit"
where Initial Commit
is the name of the commit. 键入:
git commit -m "Initial Commit"
,其中git commit -m "Initial Commit"
是Initial Commit
的名称。
The master branch was then created. 然后创建了master分支。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.