【问题标题】:Issue with committing project in Gitlab在 Gitlab 中提交项目的问题
【发布时间】:2019-06-23 15:52:44
【问题描述】:

我在 Visual Studio 中创建了一个新的 xamarin 表单项目(不是新项目,复制了我的旧项目)并尝试将整个项目提交到 Gitlab。为此,我在Gitlab 中创建了一个新项目并输入以下命令。

cd project folder
git init
git remote add origin My project remote
git add .
git commit -m "Initial commit"
git push -u origin master

但是当我推送新项目时,它会提交给我的旧项目。我已经给了新项目远程,但它被推送到旧项目(新项目是旧项目的副本)。

有没有人遇到过来自 Gitlab 的此类问题? gitlab 中是否有任何文件要保存到旧项目中?为什么我的新项目提交重定向到旧项目?

【问题讨论】:

标签: gitlab git-commit


【解决方案1】:

导航到本地存储库并执行:

此命令更改您的存储库的来源。

【讨论】:

  • 你的机器上安装了 Git 吗? “git remote -v”显示当前存储库的远程。第二个命令我改变你的起源。检查您是否有互联网连接,或者您是否使用公司代理。
  • 不知道为什么git remote add origingit remote set-url 不起作用?
  • 在我的回答中,第一个选项是命令“git remote -v”,我解释说这个命令列出了你当前的远程地址。
  • 当我推送新的更改时,我收到以下错误:hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
猜你喜欢
  • 2022-08-24
  • 1970-01-01
  • 2021-02-21
  • 2011-10-17
  • 1970-01-01
  • 2015-04-12
  • 2019-08-19
  • 2014-12-26
相关资源
最近更新 更多