git 您的存储库没有配置远程推送到
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/44557960/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Your repository has no remotes configured to push to
提问by Keith
I am using Visual Studio Code and running into the message below while trying to check in.
我正在使用 Visual Studio Code 并在尝试签入时遇到以下消息。
Your repository has no remotes configured to push to.
This is right after I upgrade from the April version on the Macintosh to the May version. I upgraded since I was getting an infinite progress bar during a git update. Does anybody have any ideas how to fix this? I have used the command line to verify that I do indeed have remotes configured. Can't post them here since it will show inter company info :(. Please help.
这是在我从 Macintosh 上的 4 月版本升级到 5 月版本之后。我升级了,因为我在 git 更新期间得到了一个无限的进度条。有没有人有任何想法如何解决这个问题?我已经使用命令行来验证我确实配置了遥控器。不能在这里发布它们,因为它会显示公司间信息:(。请帮忙。
回答by Iman
Check the Github adding a remote articleofficial doc which have better code highlighting and infos
检查Github 添加远程文章官方文档,其中具有更好的代码突出显示和信息
but if you are a experienced user,just check out below commands and note that only the first command is required and second one is just for verifyingand will return related repo details.
但如果您是有经验的用户,请查看以下命令并注意,只有第一个命令是必需的,第二个命令仅用于验证并将返回相关的 repo 详细信息。
git remote add origin https://github.com/user/repo.git
git remote -v
Git Remote addCommand dissection
Git 远程添加命令剖析
- params:
- remote name: origin (a default name for a remote Repo in Git )
- remote url: https://github.com/user/repo.git(in this example)
- 参数:
- 远程名称:origin(Git 中远程仓库的默认名称)
- 远程网址:https: //github.com/user/repo.git(在本例中)
回答by Rohit Poudel
Working with RemotesTo be able to collaborate on any Git project, you need to know how to manage your remote repositories. Remote repositories are versions of your project that are hosted on the Internet or network somewhere. You can have several of them, each of which generally is either read-only or read/write for you. Collaborating with others involves managing these remote repositories and pushing and pulling data to and from them when you need to share work. Managing remote repositories includes knowing how to add remote repositories, remove remotes that are no longer valid, manage various remote branches and define them as being tracked or not, and more. In this section, we'll cover some of these remote-management skills.
使用遥控器为了能够在任何 Git 项目上进行协作,您需要知道如何管理您的远程存储库。远程存储库是托管在 Internet 或网络某处的项目版本。您可以拥有多个,每个通常对您来说要么是只读的,要么是读/写的。与他人协作涉及管理这些远程存储库,并在您需要共享工作时将数据推入和拉出。管理远程仓库包括知道如何添加远程仓库、删除不再有效的远程仓库、管理各种远程分支并将它们定义为是否被跟踪等等。在本节中,我们将介绍其中一些远程管理技能。
Showing Your Remotes To see which remote servers you have configured, you can run the git remote command. It lists the shortnames of each remote handle you've specified. If you've cloned your repository, you should at least see origin – that is the default name Git gives to the server you cloned from:
显示您的远程服务器 要查看您配置了哪些远程服务器,您可以运行 git remote 命令。它列出了您指定的每个远程句柄的短名称。如果你已经克隆了你的仓库,你至少应该看到 origin——这是 Git 为你克隆的服务器提供的默认名称:
$ git clone https://github.com/schacon/ticgit
Cloning into 'ticgit'...
remote: Reusing existing pack: 1857, done.
remote: Total 1857 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (1857/1857), 374.35 KiB | 268.00 KiB/s, done.
Resolving deltas: 100% (772/772), done.
Checking connectivity... done.
$ cd ticgit
$ git remote
origin
You can also specify -v, which shows you the URLs that Git has stored for the shortname to be used when reading and writing to that remote:
您还可以指定 -v,它会显示 Git 为短名称存储的 URL,以便在读取和写入该远程时使用:
$ git remote -v
origin https://github.com/schacon/ticgit (fetch)
origin https://github.com/schacon/ticgit (push)
回答by Vinay Rajbhar
restart vscode editor
重新启动 vscode 编辑器
use below commands on vscode:
在 vscode 上使用以下命令:
command1: on vscode terminal change directory to project folder
command1:在 vscode 终端上将目录更改为项目文件夹
to push your vscode on github:
在 github 上推送你的 vscode:
command2: git push -u origin master
command2: git push -u origin master
github signin popup will appear signed it
github登录弹出窗口将出现签名
goto github account repository and refresh it example-->> https://github.com/username/projectfoldername
转到github帐户存储库并刷新它示例-->> https://github.com/username/projectfoldername
it worked for me n i hope it will solve your problem now your vscode file will be avalaible on github.
它对我有用,希望它可以解决您的问题,现在您的 vscode 文件将在 github 上可用。
回答by Madadinoei
enter
进入
git remote -v
git远程 -v
if see like this result
如果看到这样的结果
origin https://github.com/xxx/yyy
Close Vs Code And Open Again
关闭 Vs 代码并再次打开