无法在 xcode 中推送远程 git 分支

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9474840/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 23:28:14  来源:igfitidea点击:

Can't push on a remote git branch in xcode

xcodegitpushcommit

提问by rmonjo

I come to you because I have this really annoying issue. In xCode, I deleted some files and now, when I want to push my sources, it says that I can't since there is some uncommitted change. The uncommitted change come from the deleted files (xcode shows me these files marked with a d).

我来找你是因为我有这个非常烦人的问题。在 xCode 中,我删除了一些文件,现在,当我想推送我的源代码时,它说我不能,因为有一些未提交的更改。未提交的更改来自已删除的文件(xcode 向我展示了这些标有广告的文件)。

My question is how I make my git repo sync with it so I can push my sources ??

我的问题是如何让我的 git repo 与其同步,以便我可以推送我的源?

回答by axello

In addition to the answer of triad:

除了黑社会的回答:

  1. Select your project in the Project Navigator
  2. Select under the File menu->Source Control->Commit
  3. Select under the File menu->Source Control->Push (if you want to push it to a remote repo)
  1. 在项目导航器中选择您的项目
  2. 在 File 菜单下选择->Source Control->Commit
  3. 在 File 菜单下选择->Source Control->Push(如果要推送到远程仓库)

On the Mac it helps to research the items under the menu bar, as the popup menu is not always populated fully.

在 Mac 上,它有助于研究菜单栏下的项目,因为弹出菜单并不总是完全填充。

回答by triad

You need to commit your changes before you push onto your remote. If you go to your project directory, type:

在推送到遥控器之前,您需要提交更改。如果您转到项目目录,请键入:

git status

git status

It should show you the files which have been deleted. If it looks okay to you, type:

它应该显示已删除的文件。如果您觉得没问题,请输入:

git commit -a -m "your commit message here"

git commit -a -m "your commit message here"

Then you should be able to push to your remote repo:

然后你应该能够推送到你的远程仓库:

git push <remote> <remote_branch>

git push <remote> <remote_branch>