【问题标题】:Github unable to push [closed]Github 无法推送 [关闭]
【发布时间】:2021-10-13 20:30:37
【问题描述】:

我已经在我的 mac 上添加了一个文件夹到 GitHub 文件夹存储库,现在我在提交时遇到了问题。

On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
  (commit or discard the untracked or modified content in submodules)
    modified:   iOS-Dev-2.0/Xcodes Tutorial/.DS_Store
    modified:   iOS-Dev-2.0/Xcodes Tutorial/first-full-app-window-shopper-source (modified content, untracked content)
    modified:   iOS-Dev-2.0/Xcodes/Test01/Test_01 (modified content)

no changes added to commit (use "git add" and/or "git commit -a")

我首先通过终端尝试了一些东西 cd iOS-Courses - 这是存放 iOS-Dev-2.0 的目录 git add * git push origin master

【问题讨论】:

标签: git github


【解决方案1】:

错误/警告消息本身会告诉您进一步的步骤。

您需要使用git add 命令将更改添加到暂存区。 然后使用您的提交消息git commit 命令执行提交操作。

Git 用作分布式版本控制系统,其中每个代码都有本地副本,并且您执行所有操作添加/删除/存储/提交。除非您 commitpush(字面意思是推送到远程存储库),否则更改仅在您的计算机上。

可能你需要看看 git 基本操作是如何工作的。

  1. Saving changes
  2. git commit

【讨论】:

    【解决方案2】:

    在推送任何内容之前,您需要commit

    add 将您的更改/文件添加到 index/stage,然后将其放入 commit

    【讨论】:

      猜你喜欢
      • 2012-01-20
      • 1970-01-01
      • 2018-02-27
      • 2021-05-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-01
      相关资源
      最近更新 更多