【问题标题】:Can I push my code to the same GitHub repository if I change the project name locally on my computer?如果我在我的计算机上本地更改项目名称,我可以将我的代码推送到同一个 GitHub 存储库吗?
【发布时间】:2022-01-08 17:32:11
【问题描述】:

我正在处理一个从 GitHub 存储库克隆的项目。之前,我一直在本地和 GitHub 存储库上使用 demo/sample name 进行开发。但是现在我已经完成了,我不得不改变它的名字。

现在的问题是,我还能将我的代码从我的本地设备以不同的项目名称推送到我一直在使用但名称不同的同一个旧存储库吗?

【问题讨论】:

  • 将 repo 名称更改为 newProjectName 并重试,然后尝试添加 origin

标签: android flutter github github-actions


【解决方案1】:
Yes you can push with locally another branch.
if you didn't have git folder in your project then simple put command

 0. git init 

其他

创建新分支

  1. git checkout -b dev

添加现有分支的远程

  1. git remote add origin

然后最后推送到 GitHub

  1. git push -u origin dev.

【讨论】:

【解决方案2】:

是的,你可以。它们使用您之前在命令git remote add origin 'your link' 时提供的链接进行连接。您还可以从设置中更改 Github 应用名称。

【讨论】:

    猜你喜欢
    • 2014-03-17
    • 2015-03-11
    • 2018-07-30
    • 2021-12-19
    • 2022-01-27
    • 2022-01-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多