git - 在 github 上看不到推送的提交

标签 git github

我正在 Coursera 上完成一项作业,我们必须 fork 一个存储库、克隆一个本地版本、进行更改并提交然后推送它们。

而这一切都是我做的。但是当我检查我的 repo URL 时,我看不到我刚刚提交的推送提交? https://github.com/gcameron89777/ProgrammingAssignment2

我使用 git config 来设置用户名和电子邮件的全局值。我进入了相关目录中 stash 的 .git 文件夹的实际文件,并查看了配置文件:

url = https://github.com/gcameron89777/ProgrammingAssignment2.git

现在,当我访问该 URL 时,我看不到我的任何提交。我不应该吗?

  1. 我编辑了有问题的 .R 文件并保存了它。
  2. 然后我像这样使用提交:git commit -m "added functions makeCacheMatrix and cacheMatrix"
  3. 然后我使用 git push 进行推送

一直以来我的当前目录都是有问题的目录。

我不应该看到我最近所做的提交吗?

编辑: 这是 git status 和 git log 的输出:

RMIOMP1310:ProgrammingAssignment2 gavin.cameron$ git status
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 checkout -- <file>..." to discard changes in working directory)

    modified:   cachematrix.R

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    .DS_Store

no changes added to commit (use "git add" and/or "git commit -a")
MRMIOMP1310:ProgrammingAssignment2 gavin.cameron$ git log
commit 7f657dd22ac20d22698c53b23f0057e1a12c09b7
Author: Roger D. Peng [amelia] <rdpeng@gmail.com>
Date:   Tue Apr 22 10:09:22 2014 -0400

    More typos

commit 873d883cbbc6de667b66349c96148203cdbbb8b1
Merge: 9b22d21 4f84c6f
Author: Roger D. Peng <rdpeng@gmail.com>
Date:   Tue Apr 22 10:06:30 2014 -0400

    Merge pull request #1 from gustavdelius/master

    Fixed some minor typos.

commit 9b22d21e3671f46bf535624bbb769786840d05ba
Author: Roger D. Peng [amelia] <rdpeng@gmail.com>
Date:   Mon Apr 21 12:35:04 2014 -0400

    Clarify instructions about forking/cloning

commit 4f84c6fc9c58cfcfeb788e74fbde63549ff20100
Author: Gustav Delius <gustav.delius@gmail.com>
Date:   Tue Apr 8 22:11:14 2014 +0100

    Fixed some minor typos.

commit e4eed4153bd237a2dd4532fc3f40ce0e22fd0cb7
Author: Roger D. Peng [amelia] <rdpeng@gmail.com>
Date:   Tue Jan 14 17:16:07 2014 -0500

    A few more comments on what to do

commit 05bf4b3c78e2c1d679f0c94ae0431a281a9a137d
Author: Roger D. Peng [amelia] <rdpeng@gmail.com>
Date:   Tue Jan 14 17:10:40 2014 -0500
:

最佳答案

因为它来自git status:

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified:   cachematrix.R

您没有添加您的文件到提交中 - 所以您基本上没有提交任何内容。

执行以下操作:

git add -A
git commit -m "<commit message>"
git push

如果您想更好地了解 git 的工作原理,请阅读:http://git-scm.com/docs/gittutorial

关于git - 在 github 上看不到推送的提交,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23830678/

相关文章:

git - 没有 Git for Windows 或 Github 扩展的 Visual Studio Git 源代码管理

github - 如何强制 cdn.rawgit.com 使用更新的文件

github - 在 GitHub 上更改存储库语言

c++ - 在 Windows 上安装 CLOUD 库并绑定(bind)到 Python

git - 将标签添加到 pull 请求

Git:如何获取特定修订版本之间的文件

xcode - 创建项目后创建git仓库

php - 如何在不 merge master 分支的情况下测试 Git 分支中的代码?

javascript - Node.js package.json 是否需要位于存储库的根目录?

php - 在笔记本电脑和 PC 之间同步 eclipse 项目