[英]In Git how can you check which repo in Github you are pushing to from the command line?
I have several projects I am working on.我有几个项目正在做。 I am constantly pulling and pushing.我不断地拉和推。 Recently I made some changes to one of my files, added and committed and decided to push my project A, however it pushed into my Github Project B. I then did git pull for kicks and it this happened.最近我对我的一个文件进行了一些更改,添加并提交并决定推送我的项目 A,但是它推送到我的 Github 项目 B。然后我做了 git pull for kicks 并且它发生了。
It did not pull none of my files from Project B. I then did git status and it showed every single file/folders in my directory as needing to be committed.它没有从项目 B 中提取我的任何文件。然后我做了 git status 并显示我目录中的每个文件/文件夹都需要提交。 How would I know which "init" I am on?我怎么知道我在哪个“init”上? How can I switch out of this state and how can I disregard these blind commits without losing my files?我怎样才能退出这种状态,怎样才能在不丢失我的文件的情况下忽略这些盲目提交?
I think you need to reconfig git remote
我想你需要重新配置git remote
type git remote -v
and see if there's a mismatch or not. 输入git remote -v
并查看是否存在不匹配。
If there is, follow this instruction from github: https://help.github.com/articles/changing-a-remote-s-url/ 如果有,请按照github的说明操作: https : //help.github.com/articles/changing-a-remote-s-url/
You can check the configs of your repository by : 您可以通过以下方式检查存储库的配置:
git config -l
which contains your remote repository url. 其中包含您的远程存储库URL。
Also, you can use the following command : 此外,您可以使用以下命令:
git remote -v
If you want to change the name type如果要更改名称类型
If it doesnt accept commits after this.如果在此之后它不接受提交。 You can try你可以试试
git pull NEWNAME main git pull NEWNAME 主
git push NEWNAME main git push NEWNAME 主
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.